Node*Clone(){
numClones++;
Node*cloned=new Node(*this);
return cloned;
}
I have a default constructor (taking no arguments) and I have no declared copy constructors, so I'd expect this to simply copy the entire contents of the memory of *this and return a pointer to it.
However, I am getting error on the new line above:
Call to implicitly deleted copy constructor
Two possible issues but I don't think they should affect this:
thishas aunique_ptrattached to it. That is it contains a container of unique_ptr and is itself stored in another container of unique_ptr. But I am not moving that pointer, I am creatingnewobject not attached to the prior object, right?thisis actually a subclass ofNodebut I want to return a pointer to a base class