ShannoWu

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

2011年7月8日

摘要: 1. 代码即文档 1 // 在使用嵌套依赖类型(nested depended name)时 2 class CArray 3 { 4 public: 5 typedef int LengthType; 6 }; 7 8 template<typename T>// 此处(声明模板类型参数, template type argument)与使用template<class T>的效果一样 9 class CMatrix10 {11 public:12 // 如果不用typename指明CArray::LengthType是个嵌套依赖类型,则编译器无法确定13 // CA 阅读全文
posted @ 2011-07-08 18:24 xiangwei 阅读(615) 评论(0) 推荐(1)