CArray<int,int>&r 请问表示的是什么意思啊?

CArray是个模板类,其中成员变量、函数可用到模板形参表中的任一类型
template<class FirstType, class SecondType>
class CArray
{
public:
    FirType elem1;
    SecType elem2;
};
则声明CArray<int,int>就相当于
class CArray
{
public:
    int elem1;
    int elem2;
};
CArray<int,int>&r就是一个CArray类型变量的引用
posted @ 2011-12-27 10:34  stma  阅读(666)  评论(0)    收藏  举报