enable_if doc page says:
Constructors and destructors do not have a return type; an extra argument is the only option.
Are destructors overloadable?
It is not possible to define more than one destructor. The destructor is only one way to destroy the object create by constructor. Hence destructor can-not be overloaded.
Yes, it is possible to override the destructor of a class. In fact, when you define a class hierarchy in which polymorphism is used, you must declare a virtual destructor in the base class.
A destructor is a member function that is invoked automatically when the object goes out of scope or is explicitly destroyed by a call to delete .
Advantages of Destructor It does not accept any parameter and cannot be overloaded.
No
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With