最新的intel C++编译器是14.0.1.139或英特尔并行工作室xe 2013 sp1更新1.我想知道它是否支持隐式移动构造函数和移动赋值。我测试了下面的代码,它似乎没有工作。最新的intel C++编译器是否支持隐式移动构造函数和移动赋值?
相关文章是here(搜索移动构造函数)。它说它支持。但我无法做到。
#include <memory>
#include <iostream>
#include <algorithm>
using namespace std;
class A
{
public:
unique_ptr<int> m;
};
int main()
{
A a;
A b(std::move(a));
}
编译它在Windows作为
icl main.cpp /Qstd=c++11
错误
main.cpp
main.cpp(10): error #373: "std::unique_ptr<_Ty, _Dx>::unique_ptr(const
std::unique_ptr<_Ty, _Dx>::_Myt &) [with _Ty=int, _Dx=std::default_delete<int>]"
(declared at line 1447 of "C:\Program Files (x86)\Microsoft Visual Studio
11.0\VC\include\memory") is inaccessible unique_ptr<int> m;
^
detected during implicit generation of "A::A(const A &)" at line 16
compilation aborted for main.cpp (code 2)
基本上在主函数A b(std::move(a));
二号线正在寻找的拷贝构造函数A::A(const A &)
少动构造A::A(const A &&)
等。当没有隐式移动构造函数被生成时,这是通常的。但编译器表示它支持隐式移动构造函数。我很困惑。谢谢。
你可以看看这里http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler – ForEveR
相关文章是http://software.intel.com/en-us/articles/intel-composer-xe-2013-compilers-sp1-fixes-list。它表示支持。但我无法做到。 – user1899020
“似乎不起作用”是什么意思? – juanchopanza