+ -
当前位置:首页 → 问答吧 → 模板类

模板类

时间:2011-12-21

来源:互联网

template<class T,class E>
class Graphmtx{
T *VerticesList;
E * * Edge;
int maxVertices;//图中最大顶点数
int numEdges;
int numVertices;
public:
Graphmtx(int sz=20);
bool InsertEdge(int v1,int v2,E weight);
int GetVertexPos(T el);
friend istream& operator>>(istream& in,Graphmtx<T,E>& G);
friend osTream& operator<<(ostream& out,Graphmtx<T,E>& G);

};
在vc6.0中定义上述类之后,但类视图中并不限时,把template<class T,class E>注释掉之后类视图中就会出现,这是怎么回事

作者: zk3389   发布时间: 2011-12-21

VS2005显示正常,楼主还是别用VC6了吧,VS速度不慢,对C++的支持也好的多

作者: RabbitLBJ   发布时间: 2011-12-22

我这样定义这个类可有错误?我的编译通不过

作者: zk3389   发布时间: 2011-12-22

远离vc6吧

作者: quwei197874   发布时间: 2011-12-22

VC6……

作者: riyueming184   发布时间: 2011-12-22

该升级了

作者: krh2001   发布时间: 2011-12-22