Tutorial 9 HW, making Poo/Dude class, error "attempting to reference a deleted function"

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
talby
Posts: 1
Joined: August 9th, 2020, 6:02 pm

Tutorial 9 HW, making Poo/Dude class, error "attempting to reference a deleted function"

Post by talby » August 10th, 2020, 11:17 am

I cannot for the life of me, after much googling and fiddling around, figure out what the hell this means or how to fix it. The line number the error gives is just a single open curly brace, with no Poo on either side. I thought this was gonna be so easy but what the heck

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Tutorial 9 HW, making Poo/Dude class, error "attempting to reference a deleted function"

Post by albinopapa » August 10th, 2020, 4:00 pm

That error message means that you are attempting to access a function that isn't available. For instance, Poo() or Dude() for default constructors. Poo(const Poo&) or Dude( const Dude& )for copy constructors or Poo& operator=( const Poo& ) or Dude& operator=( const Dude& ) for copy assignment operators.

Possible causes for this is you have a member in Poo or Dude that doesn't have a default constructor or copy assignment operator that is either explicitly or implicitly defined. You are trying to make a default Poo/Dude object when no default constructor is defined. You are trying to pass a Dude/Poo object by value to a function when a copy assignment operator isn't defined or a member of Poo/Dude has their copy assignment operator deleted.

If this doesn't help, share the code and we'll be able to take a look at it and be more precise.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Post Reply