I notice that the declaration of delete
in the directory of gcc source gcc/libstdc++-v3/libsupc++/new
is
void operator delete(void*)
void operator delete[](void*)
Why can we pass const ptr
to the operator?
const int* a = new int(1);
delete(a);
I think void*
and const int*
are incompatible types.