Ray's playground

 

2012年3月13日

Item 26: Limiting the number of objects of a class.(More Effective C++)

摘要: Now consider what inline means. Conceptually, it means compilers should replace each call to the function with a copy of the function body, but for non-member functions, it also means something else. It means the functions in question have internal linkage. You don't ordinarily need to worry ... 阅读全文

posted @ 2012-03-13 14:26 Ray Z 阅读(169) 评论(0) 推荐(0) 编辑

Item 25: Virtualizing constructors and non-member functions.(More Effective C++)

摘要: Consider what readComponent does. It creates a new object, either a TextBlock or a Graphic, depending on the data it reads. Because it creates new objects, it acts much like a constructor, but because it can create different types of objects, we call it a virtual constructor. A virtual construc... 阅读全文

posted @ 2012-03-13 10:45 Ray Z 阅读(216) 评论(0) 推荐(0) 编辑

导航