程序源代码:
#include<map>
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main()
{
typedef vector<string> children;
map<string,children> family;
family["aa"].push_back("b");
family["aa"].push_back("bb");
family["cc"].push_back("d");
family["cc"].push_back("dd");
family["zz"].push_back("ff");
family["yy"].push_back("ee");
map<string,children>::iterator iter;
for(iter=family.begin();iter!=family.end();++iter)
{
cout<<(*iter).first<<":";
int cnt=0;
vector<string> names=(*iter).second;
vector<string>::iterator liter;
for(liter=names.begin();liter!=names.end();++liter)
{
if(cnt)
cout<<",";
else
cnt++;
cout<<*liter;
}
cout<<endl;
}
cout<<endl;
return 0;
}
程序功能:输出我设置的map信息
问题:
1,出现了146个warnings
2,我列出其中的warnings:
D:\programe\C++ primer\text\main.cpp(11) : see reference to class template instantiation 'std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<
char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::vector<std::basic_string<char,std::char_traits<char>
,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > > >' being compiled
c:\program files\microsoft visual studio\vc98\include\xtree(120) : warning C4786: 'std::_Tree<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,
std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > >,std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,
std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
,std::allocator<std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > > >::_Kfn,std::less<std::basic_string<char,std::char_traits<char
>,std::allocator<char> > >,std::allocator<std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > > >::const_iterator' : identifier was
truncated to '255' characters in the debug information
如果一条错误信息夹在里面,我根本没办法发现我的错误在那里?
3。这里的warings都是这样的:identifier was truncated to '255' characters in the debug information。
怎么解决这样的问题,是不是我少写了什么语句,请大虾指点:)谢谢:)