有精通c++ template的大狭吗?帮帮我啊,急!!!!
我写了这样一个类
struct obj
{
....
}
template<class T,int M>
class cheshi
{
}
实例化如下
cheshi<obj,14> mm;
cheshi <obj,12> nn;
想在xiaoxiao函数里调用
xiaoxiao(mm,nn)
声明如下:
template<class T,int M> void xiaoxiao(Cceshi<T,M> m_1,Cceshi<T,M> m_2)
但编译出错 ,可是我怎样传参数 mm,nn ?????????
问题点数:80、回复次数:3Top
1 楼hanmlxiao(hanml)回复于 2005-11-03 14:41:48 得分 0
定义都有问题,找本书好好看看吧Top
2 楼hdt(倦怠)回复于 2005-11-03 14:49:52 得分 0
template<class T,int M> void xiaoxiao(Cceshi<T,M> m_1,Cceshi<T,M> m_2)
===============>
template<class T,int M1 ,int M2 > void xiaoxiao(Cceshi<T,M1> m_1,Cceshi<T,M2> m_2)
Top
3 楼woshibaise_()回复于 2005-11-03 14:56:00 得分 0
谢谢大狭,小女初学,以后还请多多关照Top




