Item 51: Adhere to convention when writing new and delete(Effective C++)
时间:2011-04-10 来源:Ray Z
operator new should contain an infinite loop trying to allocate memory, should call the new-handler if it can't satisfy a memory request, and should handle requests for zero bytes. Class-specific versions should handle requests for larger blocks than expected.
operator delete should do nothing if passed a pointer that is null. Class-specific versions should handle blocks that are larger than expected.
operator delete should do nothing if passed a pointer that is null. Class-specific versions should handle blocks that are larger than expected.
相关阅读 更多 +
排行榜 更多 +