Ray's playground

 

2011年4月8日

Item 47: Use traits classes for information about types(Effective C++)

摘要: Traits classes make information about types available during compilation. They're implemented using templates and template specializations. In conjunction with overloading, traits classes make it possible to perform compile-time if...else tests on types. 阅读全文

posted @ 2011-04-08 22:03 Ray Z 阅读(129) 评论(0) 推荐(0) 编辑

Item 46: Define non-member functions inside templates when type conversions are desired(Effective C++)

摘要: When writing a class template that offers functions related to the template that support implicit type conversions on all parameters, define those functions as friends inside the class template. 阅读全文

posted @ 2011-04-08 11:56 Ray Z 阅读(195) 评论(0) 推荐(0) 编辑

导航