struct Foo
{
Foo() = default;
Foo(Foo&&) = default;
};
int main()
{
Foo a, b;
a = b;
// ^
return 0;
}
Run Code Online (Sandbox Code Playgroud)
错误:使用已删除的函数'Foo&Foo :: operator =(const Foo&)'
在g ++ 4.6 -std = c ++ 0x中没关系.但是,在g ++ 6.2 -std = c ++ 11中,这是错误的.为什么?