This section discusses modeling an assignment operator for a C++ class. To generate this assignment operator for a C++ class named Class1, perform these steps
这部分讨论的是为 C++类建模一个赋值操作符。
An assignment operator shall be implemented by a non-static member function with exactly one parameter.
赋值操作符应该实现为带一个参数的非静态成员函数。
An assignment operator was not accessible in a base class and was therefore not generated for a derived class.
基类中的赋值运算符不可访问,因此无法为派生类生成赋值运算符。
An assignment operator was not accessible in a base class and was therefore not generated for a derived class.
基类中的赋值运算符不可访问,因此无法为派生类生成赋值运算符。
应用推荐