Suppose I have:
struct A
{
A(int x) : m_x(x) { }
A(A&&) = delete;
int m_x;
}
and:
A a(3); // Ok
auto a = A(3); // Error: function A(int&&) cannot be referenced - it's a deleted function
Why does the latter call to the move constructor? Why are these 2 statement different in terms of generated code?
Aucun commentaire:
Enregistrer un commentaire