Ray's playground

 

Item 4: Make sure that objects are initialized before they're used (Effective C++)

  Manually initialize objects of built-in type, because C++ only sometimes initializes them itself.

  In a constructor, prefer use of the member initialization list to assignment inside the body of the constructor. List data members in the initialization list in the same order they're declared in the class.

  Avoid initialization order problems across translation units by replacing non-local static objects with local static objects.

posted on 2009-11-23 21:50  Ray Z  阅读(247)  评论(0编辑  收藏  举报

导航