一个关于map的问题,请高手指教!

fx3751 2005-02-27 10:50:33
我用VC中的C++编译器,new一个map时总是出现一堆warning信息,如
map<char,short,less<char>,allocator<short> > *word_map=new map<char,short,less<char>,allocator<short> >;


--------------------Configuration: TestMap - Win32 Debug--------------------
Compiling...
TestMap.cpp
F:\C++\TestMap.cpp(18) : warning C4786: 'std::reverse_bidirectional_iterator<std::_Tree<char,std::pair<char const ,short>,std::map<char,short,std::less<char>,std::allocator<short> >::_Kfn,std::less<char>,std::allocator<short> >::iterator,std::pair<c
har const ,short>,std::pair<char const ,short> &,std::pair<char const ,short> *,int>' : identifier was truncated to '255' characters in the debug information
F:\C++\TestMap.cpp(18) : warning C4786: 'std::reverse_bidirectional_iterator<std::_Tree<char,std::pair<char const ,short>,std::map<char,short,std::less<char>,std::allocator<short> >::_Kfn,std::less<char>,std::allocator<short> >::const_iterator,std::
pair<char const ,short>,std::pair<char const ,short> const &,std::pair<char const ,short> const *,int>' : identifier was truncated to '255' characters in the debug information
F:\C++\TestMap.cpp(18) : warning C4786: 'std::pair<std::_Tree<char,std::pair<char const ,short>,std::map<char,short,std::less<char>,std::allocator<short> >::_Kfn,std::less<char>,std::allocator<short> >::iterator,std::_Tree<char,std::pair<char const
,short>,std::map<char,short,std::less<char>,std::allocator<short> >::_Kfn,std::less<char>,std::allocator<short> >::iterator>' : identifier was truncated to '255' characters in the debug information
F:\C++\TestMap.cpp(18) : warning C4786: 'std::pair<std::_Tree<char,std::pair<char const ,short>,std::map<char,short,std::less<char>,std::allocator<short> >::_Kfn,std::less<char>,std::allocator<short> >::const_iterator,std::_Tree<char,std::pair<char
const ,short>,std::map<char,short,std::less<char>,std::allocator<short> >::_Kfn,std::less<char>,std::allocator<short> >::const_iterator>' : identifier was truncated to '255' characters in the debug information
f:\program files\microsoft visual studio\vc98\include\xtree(182) : warning C4786: 'std::_Tree<char,std::pair<char const ,short>,std::map<char,short,std::less<char>,std::allocator<short> >::_Kfn,std::less<char>,std::allocator<short> >::~_Tree<char,st
d::pair<char const ,short>,std::map<char,short,std::less<char>,std::allocator<short> >::_Kfn,std::less<char>,std::allocator<short> >' : identifier was truncated to '255' characters in the debug information
f:\program files\microsoft visual studio\vc98\include\xtree(162) : warning C4786: 'std::_Tree<char,std::pair<char const ,short>,std::map<char,short,std::less<char>,std::allocator<short> >::_Kfn,std::less<char>,std::allocator<short> >::_Tree<char,std
::pair<char const ,short>,std::map<char,short,std::less<char>,std::allocator<short> >::_Kfn,std::less<char>,std::allocator<short> >' : identifier was truncated to '255' characters in the debug information
Linking...

TestMap.exe - 0 error(s), 6 warning(s)
哪位高手能给个正确的map用法吗,谢谢!
...全文
140 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
healer_kx 2005-02-27
  • 打赏
  • 举报
回复
在VC7下不会有的, 你的编译符号太长了.

#pragma warning(disable:4786)
lw1a2 2005-02-27
  • 打赏
  • 举报
回复
有些编译器可以省略参数3和参数4,直接用map<char,short>,不知道VC是不是这样
hxblvc 2005-02-27
  • 打赏
  • 举报
回复
你的用法是对的.
hxblvc 2005-02-27
  • 打赏
  • 举报
回复
在你的代码前加上这句:
#pragma warning(disable:4786)
cxc014 2005-02-27
  • 打赏
  • 举报
回复
正常现象
ryth 2005-02-27
  • 打赏
  • 举报
回复
找bill看看
fx3751 2005-02-27
  • 打赏
  • 举报
回复
加了#pragma warning(disable:4786),warning只有2个了,舒爽多了,谢谢

64,636

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧