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类型变量的引用