On 4/17/2012 8:50 AM,
wrote:
> 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.
Instead, decide what you need a particular class to do, or group of
classes. You are in the danger zone when you start thinking along the
lines of "All classes should do X."
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....