65,208
社区成员
发帖
与我相关
我的任务
分享
typedef wchar unsigned short;
typedef std::map< std::vector<wchar>, std::vector<wchar> > STRING2VECTOR; //可以这样嵌套不??
STRING2VECTOR testMap;
STRING2VECTOR::iterator iter;
for(iter = testMap.begin(); iter != testMap.end(); iter++)
{
std::vector<wchar>::iterator nameiter = regexiter = iter->first.begin(); //总是出错!!!
std::vector<wchar>::iterator regexiter = regexiter = iter->second.begin(); //正常
for(; regexiter != iter->second.end(); regexiter++)//正常
{
std::cout << *regexiter << " ";
}
for(; nameiter != iter->first.end(); nameiter++)//出错
{
std::cout << *nameiter << " ";
}
}
//特别长的一段错误提示,只是提取了前两个
/*
错误: ‘operator<<’在‘std::cout << iter.std::_Rb_tree_iterator<_Tp>::operator* [with _Tp = std::pair<const std::vector<short unsigned int>, std::vector<short unsigned int> >, std::_Rb_tree_iterator<_Tp>::reference = std::pair<const std::vector<short unsigned int>, std::vector<short unsigned int> >&]().std::pair<const std::vector<short unsigned int>, std::vector<short unsigned int> >::first’中没有匹配
di.cpp:81:24: 附注: 备选是:
/usr/include/c++/4.6/ostream:110:7: 附注: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
*/
[/quote]可以