![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
qq402613110
这个作者很懒,什么都没留下…
展开
-
C++模板泛型特化
C++模板泛型特化的两种方式: 一、在头文件中声明泛型,在源文件中特化,代码如下 //在头文件中声明 template<typename T> class test { public: test(); ~test(); }; //源文件中定义 #include "test.h" template <typename T>...原创 2019-01-08 11:38:38 · 542 阅读 · 0 评论 -
C++模板使用总结
1. map的value值为模板类,在使用迭带器时应该前面加typename typename map<int,IValue<T>*>::iterator itr; 2. 在模板类继承中,如果要使用基类的成员变量或方法,则需要加 this->xx,this->func(); 亲测在linux下编译会报错,在windows下用VS编译没有问题。 ...原创 2019-04-02 14:49:21 · 286 阅读 · 0 评论