B
bob
In C++, is there a class like the Java Object class that all classes derive from?
In C++, is there a class like the Java Object class that all classes
derive from?
In C++, is there a class like the Java Object class that all classes derive from?
I've seen a good number of people coming from java that decided to roll
their own in C++, and more times then not, it ends up causing problems.
For example, do all classes really need a ToString() method? Surely,
there are going to be some classes where a string representation either
makes no sense or has little value.
However, it might make sense to have
some common method like ToXml() for all configuration classes....
Unfortunate example, since the standard way to do this in C++ is to
provide a ostream << Foo overload. No common superclass needed.
In C++, is there a class like the Java Object class that all classes derive from?
But that will dispatch according to the static (compile-time) type, not
the dynamic (run-time) type.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.