1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| class Person { public: // Person() { // cout << "Person()" << endl; // }; ~Person() { cout << "~Person()" << endl; };
// Person(const Person& Person) { // cout << "Person(Person& Person)" << endl; // }
Person(Person&& Person) { cout << "Person(Person&& Person)" << endl; }
Person& operator=(const Person&) { cout << "operator=(const Person&)" << endl; return *this; } };
int main() { Person person; //编译报错,找不到匹配的构造函数 return 0;
}
|