更新时间:2023-11-14 22:24:40
除语法和 free
与 delete
,
:: operator new
; malloc
带有 realloc
,而 new
没有等效项; new
具有 new_handler
,没有 malloc
::operator new
;malloc
comes with realloc
, for which new
has no equivalent;new
has the concept of a new_handler
, for which there is no malloc
equivalent.(替换 m alloc
打开可以蠕虫。可以做到,但不能移植,因为它需要链接程序的知识。)
(Replacing malloc
opens up a can of worms. It can be done, but not portably, because it requires knowledge of the linker.)