Hello,
I have some java code I want to port to C++, and first class in the Heirarchy has me stumped. I'm trying to port a simple parsing framework as an exercise to figure out how it works internally, and almost everything in the framework requires, uses, or is PubliclyClonable
a class defined in java as:
public abstract class PubliclyCloneable{
public abstract Object clone();
}
As C++ has no Object class I wanted to define the C++ version like this:
class Cloneable{
virtual Cloneable clone()=0;
}
Visual Studio Intellisense says this isn't allowed, and I don't have a .cpp to actaully attempt to compile yet. that is the only code in my project so far. Is the proper way to do this to make a pure virtual operator=
? what would be the best way to define this high level class in the heirarchy that would ensure an always deep copy of a class?
For those curious about the framework I'm trying to port it is from the book Building Parsers with Java and the source code is on its website.