想知道是否有人可以帮助我。下面的代码给了我这个错误:致命错误C1903:无法从以前的错误中恢复;停止编译
template <class T>
class CompareList
{
public:
CompareList( const long& lBlobFeature, const bool& bIsAscending )
{
...
}
bool operator()( T &lhs, T &rhs )
{
double dFirstValue = lhs.GetValue( ... );
double dSecondValue = rhs.GetValue( ... );
if( m_bIsAscending ) // Sort Ascending.
{
if( dFirstValue < dSecondValue )
return true;
else
return false;
}
else // Sort Descending.
{
if( dFirstValue > dSecondValue )
return true;
else
return false;
}
}
};
CVParentList *m_pList;
m_pList = new CVChildList[ nBlobs ]; //CVChildList is a derived class of CVParentList
std::sort( m_pList, m_pList+GetBlobsNumber(), CompareList <CVChildList> ( lBlobFeature, TRUE) );
编辑: 我真的很抱歉,实际上这是第一个错误:错误 C2664: 'bool CompareList ::operator ()(T &,T &)' : cannot convert parameter 1 from 'CVParentList' to 'CVChildList &'
“致命错误 C1903:无法从以前的错误中恢复;停止编译”之后出现,我只看到最后一条错误消息。非常抱歉。