Ray's playground

 

2011年4月6日

Item 44: Factor parameter-independent code out of templates(Effective C++)

摘要: Templates generate multiple classes and multiple functions, so any template code not dependent on a template parameter causes bloat. Bloat due to non-type template parameters can often be eliminated by replacing template parameters with function parameters or class data members. Bloat due to type p. 阅读全文

posted @ 2011-04-06 20:27 Ray Z 阅读(204) 评论(0) 推荐(0) 编辑

Core Data Relationships(Chapter 30 of Cocoa Programming for Mac OS X)

摘要: 1#import"Department.h"2#import"Employee.h"34@implementationDepartment5@dynamicdeptName;6@dynamicemployees;7@dynamicmanager;89/*10-(void)addEmployeesObject:(NSManagedObject*)value{11NSSet*changedObjects=[[NSSetalloc]initWithObjects:&valuecount:1];12[selfwillChangeValueForKey:@ 阅读全文

posted @ 2011-04-06 19:59 Ray Z 阅读(230) 评论(0) 推荐(0) 编辑

Item 43: Know how to access names in templatized base classes(Effective C++)

摘要: In derived class templates, refer to names in base class templates via a "this->" prefix, via using declarations, or via an explicit base class qualification. 阅读全文

posted @ 2011-04-06 10:02 Ray Z 阅读(177) 评论(0) 推荐(0) 编辑

导航