读书人

模版Set的有关问题 请大家帮下忙多谢了

发布时间: 2012-02-07 17:45:37 作者: rapoo

模版Set的问题 请大家帮下忙谢谢了
class CCountry;

class CRS
{
bool OpenRS(const set <CCountry> ::iterator &CountryIt, HMODULE &hModule);
//定义函数
}

class CCountry
{
}


错误提示:

d:\program files\microsoft visual studio\vc98\include\xtree(28) : error C2079: '_Value ' uses undefined class 'CCountry '
d:\program files\microsoft visual studio\vc98\include\set(33) : see reference to class template instantiation 'std::_Tree <class CCountry,class CCountry,struct std::set <class CCountry,struct std::less <class CCountry> ,class std::allocator <clas
s CCountry> > ::_Kfn,struct std::less <class CCountry> ,class std::allocator <class CCountry> > ' being compiled


这是什么问题呢?前辈们帮下小弟 万分感谢

[解决办法]
把class CCountry定义体提到CRS前面。

读书人网 >C++

热点推荐