Ray's playground

 
上一页 1 2 3 4 5 6 7 ··· 56 下一页

2012年3月26日

Item 35: Familiarize yourself with the language standard.(More Effective C++)

摘要: Familiarize yourself with the language standard. 阅读全文

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

Item 34: Understand how to combine C++ and C in the same program.(More Effective C++)

摘要: Make sure the C++ and C compilers produce compatible object files.Declare functions to be used by both languages extern "C".If at all possible, write main in C++.Always use delete with memory from new; always use free with memory from malloc.Limit what you pass between the two languages to 阅读全文

posted @ 2012-03-26 12:04 Ray Z 阅读(225) 评论(0) 推荐(0) 编辑

2012年3月23日

Item 33: Make non-leaf classes abstract.(More Effective C++)

摘要: The general rule remains: non-leaf classes should be abstract. You may need to bend the rule when working with outside libraries, but in code over which you have control, adherence to it will yield dividends in the form of increased reliability, robustness, comprehensibility, and extensibility t... 阅读全文

posted @ 2012-03-23 14:25 Ray Z 阅读(311) 评论(0) 推荐(0) 编辑

2012年3月22日

Prototype(Chapter 3 of Pro Objective-C Design Patterns for iOS)

摘要: The Prototype pattern is one of the simplest design patterns. A client knows an abstractPrototype class. At runtime any object that is a subclass of the abstract Prototype canbe cloned at the client’s will. So the client can make multiple instances of the same typewithout creating them manually. 阅读全文

posted @ 2012-03-22 18:22 Ray Z 阅读(265) 评论(0) 推荐(0) 编辑

Item 32: Program in the future tense.(More Effective C++)

摘要: Good software adapts well to change. It accommodates new features, it ports to new platforms, it adjusts to new demands, it handles new inputs. Software this flexible, this robust, and this reliable does not come about by accident. It is designed and implemented by programmers who conform to th... 阅读全文

posted @ 2012-03-22 10:40 Ray Z 阅读(291) 评论(0) 推荐(0) 编辑

2012年3月21日

Item 31: Making functions virtual with respect to more than one object.(More Effective C++)

摘要: Let us assume, however, that you must implement your game in C++ — that you must come up with your own way of implementing what is commonly referred to as double-dispatching. (The name comes from the object-oriented programming community, where what C++ programmers know as a virtual function ca... 阅读全文

posted @ 2012-03-21 17:31 Ray Z 阅读(252) 评论(0) 推荐(0) 编辑

2012年3月20日

Item 30: Proxy classes.(More Effective C++)

摘要: Proxy classes allow you to achieve some types of behavior that are otherwise difficult or impossible to implement. Multidimensional arrays are one example, lvalue/rvalue differentiation is a second, suppression of implicit conversions (see Item 5) is a third. At the same time, proxy classes hav... 阅读全文

posted @ 2012-03-20 13:01 Ray Z 阅读(179) 评论(0) 推荐(0) 编辑

2012年3月16日

Item 29: Reference counting.(More Effective C++)

摘要: TBD 阅读全文

posted @ 2012-03-16 13:02 Ray Z 阅读(141) 评论(0) 推荐(0) 编辑

2012年3月15日

Item 28: Smart pointers.(More Effective C++)

摘要: When you use smart pointers in place of C++'s built-in pointers (i.e., dumb pointers), you gain control over the following aspects of pointer behavior:Construction and destruction. You determine what happens when a smart pointer is created and destroyed. It is common to give smart pointers a def 阅读全文

posted @ 2012-03-15 14:33 Ray Z 阅读(236) 评论(0) 推荐(0) 编辑

2012年3月14日

Item 27: Requiring or prohibiting heap-based objects.(More Effective C++)

摘要: The idea is to take advantage of the fact that when an object is allocated on the heap, operator new is called to allocate the raw memory, then a constructor is called to initialize an object in that memory. Preventing clients from directly instantiating objects on the heap is easy, because such... 阅读全文

posted @ 2012-03-14 15:06 Ray Z 阅读(170) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 56 下一页

导航