当在使用STL时,VC有时会提出类似以下的警告:

来源:互联网 发布:感谢网络让我遇见你 编辑:程序博客网 时间:2024/05/16 12:28
 当在使用STL时,VC有时会提出类似以下的警告:
Compiling...
test.cpp
C:/Windows/Desktop/test/test.cpp(13) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std
::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,int>' : identifier was truncated to '255' characters in the debug information

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/C4786.asp给了很好的解释.
都是因为VC对STL的不完全支持造成的.

解决方法:
#ifdef WIN32
  #pragma warning (disable: 4514 4786)
#endif