overloading new and delete in c++

前端 未结 2 1874
北海茫月
北海茫月 2021-01-14 20:49

HI All,

I was trying to overload new and delete to fix a memory leak problem in my project. But got stuck with some compilation error.

Currently this code is

2条回答
  •  死守一世寂寞
    2021-01-14 21:14

    the signature don't match it sould be void* operator new (size_t size).

    overriding single object new signature is static void * operator new(site_t size),

    roni

提交回复
热议问题