Syntax for the destructor of a nameless class
Syntax for the destructor of a nameless class
(OP)
This is one of those mmm I wonder how you would do that questions. In C++, we can declare nameless classes like
In a named class, if I want Destroy to be called when the object is deleted, I put it in the destructor (~name). What is the syntax for the destructor in a nameless class? The only thing I can think of is a delete operator.
CODE
class { public: void Create () { ... } void Destroy () { ... } } noname;
CODE
void operator ~() // doesn't get called operator ~() // produces a syntax error ~() // produces a syntax error
RE: Syntax for the destructor of a nameless class