Why is the move constructor defined and the assignment operator implicitly deleted?

Viewed 2414
struct Foo
{
    Foo() = default;
    Foo(Foo&&) = default;
};

int main()
{
    Foo a, b;
    a = b;
   // ^ 

   return 0;
}

error: use of deleted function 'Foo& Foo::operator=(const Foo&)'

in g++4.6 -std=c++0x it's ok. but, in g++6.2 -std=c++11 it's error. why?

2 Answers
Related