我的項目在Visual Studio 2012中正常運行和編譯。但是,我試圖用VS 2015在計算機中打開它,我得到了156個錯誤。都是相同的,都在同一個文件和同三線: 嚴重性代碼說明項目文件的線路抑制狀態將VS 2012遷移到VS 2015後C++項目中的Xmemory錯誤
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
我只是得到這些相同的3個錯誤每52次,共156沒有一個錯誤來自我的代碼,都是這個xmemory0文件。
請大多數[MCVE](http://stackoverflow.com/help/mcve) –
你不是試圖保存對STL容器中的東西的引用嗎?或常量? http://connect.microsoft.com/VisualStudio/feedbackdetail/view/949932/visual-c-14-ctp3-compile-errors-in-xmemory0 –
@SamiKuhmonen似乎已經解決了這個問題,儘管如果有人知道我會感激任何方式來跟蹤這些問題的來源(錯誤不顯示他們正在發生的文件) – user3713929