A
Alfonso Morra
Is it possible to declare a class destructor as private?
Is it possible to declare a class destructor as private?
I already did and found the answer (that's why I deleted the OP).Ken said:Try it and see.
Not necessarily true. This is a nested class that must not be accesibleI would venture not though because the program would no longer be able
to call it.![]()
True, but if the class/function were made a friend, it would have
access to the class's destructor.
Ken said:Try it and see.
I would venture not though because the program would no longer be able
to call it.![]()
Mercator said:There exists a well-known compiler (from a very big company) that
ignores the private-ness of destructors.
John said:If it is the company that I am thinking of, then I am unable to reproduce
this. In particular, the following code won't compile on versions 6.0, 7.1
and 8.0 Beta 2 (I haven't tested 7.0):
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.