我們正在將一些C++代碼從windows移植到mac,並且在使用C++ 11編譯LLVM 6.1時遇到問題。我們在「調用隱式刪除的副本構造器」的地方遇到錯誤。這些錯誤中的一部分出現在我們的代碼中。在LLVM中調用隱式刪除的拷貝構造函數
for (auto it : _unhandledFiles)//ERROR HERE
{
if (it.first == file)
{
return true;
}
}
return false;
但是,它們也出現在LLVM編譯器的存儲器文件以及矢量文件中。
template <class _Up, class... _Args>
_LIBCPP_INLINE_VISIBILITY
void
construct(_Up* __p, _Args&&... __args)
{
::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);//ERROR HERE
}
vector<_Tp, _Allocator>::operator=(const vector& __x)
{
if (this != &__x)
{
__base::__copy_assign_alloc(__x);
assign(__x.__begin_, __x.__end_);//ERROR HERE
}
return *this;
}
在將C++代碼從Windows移植到Mac時,有沒有人遇到過這個錯誤?我覺得好像它是編譯器相關的,必須有一些簡單的修復,我只是不知道,因爲我得到的地方,我實際上不能編輯(內存,矢量等....)的錯誤
'_unhandledFiles'的類型是什麼?請[編輯](http://stackoverflow.com/posts/30850780/edit)您的問題與[SSCCE](http://sscce.org)。 – NathanOliver
'_unhandledFiles'中的東西是可複製的嗎? – Barry
std :: vector _unhandledFiles; –