Advertisement

pls answer this... A class that has a protected constructor:

Started by January 10, 2002 09:26 AM
10 comments, last by mickey 22 years, 10 months ago
quote: Original post by MadKeithV
How about

e) Is used to create Singleton classes.




Surely you would make the constructor private, unless you were planning to derive classes from it.....

....in which case you would probably want a virtual destructor.

Hahah sandman, yes, indeed!

DEFINATELY any class that is not 100% certain to never be derived should have a virtual destructor. I''ve seen some really nasty bugs with that one, from code that was "tried and true" according to other people. Ick!

People might not remember what you said, or what you did, but they will always remember how you made them feel.
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.

This topic is closed to new replies.

Advertisement