C++ Virtual operator delete?

前端 未结 4 1517
没有蜡笔的小新
没有蜡笔的小新 2020-12-31 05:59

Is it possible to have a virtual delete operator? I\'m not talking destructor, I mean the actual operator overload.

Minus the fact that it is (in most cases) a big

4条回答
  •  滥情空心
    2020-12-31 06:17

    1) Yes, of course you can overload delete. No, the overload cannot be a virtual function.

    2) "Pros and Cons" depend on entirely what you're trying to do.

    3) Of course, the whole idea of operator overloading - like so much in C++ - is arguably stupid, unnecessary and dangerous.

    SOOOOOO .....

    4) If you don't NEED it, then don't DO IT :)

    IMHO...

提交回复
热议问题