这些是我的原型,
MyClass& operator=(MyClass rhs); // copy assignment
MyClass& operator=(MyClass &&rhs); // move assignment
但是当我打电话
MyClass a, b;
a = std::move(b);
, 有错误。
556 IntelliSense: more than one operator "=" matches these operands:
function "MyClass::operator=(MyClass rhs)"
function "MyClass::operator=(MyClass &&rhs)"
operand types are: MyClass = MyClass
编译器返回:
Error 56 error C2593: 'operator =' is ambiguous