Thus, the destructor code cannot assume that the object is fully initialized, and you should beware of calling functions on pointers which may not yet be set to point to valid objects.

 
  • 那么,我们可以直接使用下面的代码,对新分配的对象进行操作,而并不需要在分配之后人为地显式检测对象内存分配的成功与否。
今日热词
目录 附录 查词历史