我有这个代码
namespace MSL{
template <typename T> class TListNode;
template <typename T> class TList;
...
和
template <typename T>
int TList<T>::add(T v) {
TListNode<T> *pn;
pn = new TListNode<T>;
...
和
class TMergeNode {
public:
inline TMergeNode(int cluster1=-1, int cluster2=-1, TCMData mergeVal=0);
inline TMergeNode(TMergeNode &b); // copy constructor
...
它使用旧版本的 g++ 编译正常,但现在使用 4.7 版我收到以下错误:
./msl/MSL_List_Template.h: In instantiation of ‘int MSL::TList<T>::add(T) [with T = TMergeNode]’:
clustermerges.cpp:282:33: required from here
./msl/MSL_List_Template.h:616:23: error: no matching function for call to ‘TMergeNode::TMergeNode(TMergeNode)’
./msl/MSL_List_Template.h:616:23: note: candidates are:
In file included from main.cpp:78:0:
clustermerges.cpp:70:8: note: TMergeNode::TMergeNode(TMergeNode&)
clustermerges.cpp:70:8: note: no known conversion for argument 1 from ‘TMergeNode’ to ‘TMergeNode&’
clustermerges.cpp:68:8: note: TMergeNode::TMergeNode(int, int, MSL::TCMData)
clustermerges.cpp:68:8: note: no known conversion for argument 1 from ‘TMergeNode’ to ‘int’
任何想法将不胜感激