use*_*929 6 c++ compiler-errors visual-studio visual-studio-2012 visual-studio-2015
我的项目在Visual Studio 2012中正常工作和编译.但是我试图在VS 2015的计算机上打开它,我得到156个错误.所有相同和全部在同一个文件中并且相同的3行:严重性代码描述项目文件行抑制状态
Error C2338 The C++ Standard forbids containers of const elements because allocator<const T> is ill-formed. leaf c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 585
Error C2535 'const long *std::allocator<_Ty>::address(const long &) noexcept const': member function already defined or declared leaf c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 613
Error C2535 'const long *std::_Wrap_alloc<std::allocator<_Ty>>::address(const long &) const': member function already defined or declared leaf c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 846
Run Code Online (Sandbox Code Playgroud)
我只获得了相同的3个错误,共52次,总共156次.我的代码没有出现任何错误,都是这个xmemory0文件.
我假设您正在尝试将STL容器与consts 一起使用?C ++标准禁止这样做,但是Visual C ++的早期版本允许这样做。新的编译器在这方面更符合标准,并且会像您一样产生错误。
可能可以对“ <const”进行简单的“在文件中查找”,以检查整个源代码中是否存在类似内容。
| 归档时间: |
|
| 查看次数: |
5333 次 |
| 最近记录: |