如何从复制赋值运算符调用复制构造函数?
How to call to the copy constructor from the copy-assignment operator?
现在,尝试为类a使用一个复制结构和运算符赋值,在清单15中声明该类。
Now, try using a copy construction and operator assignment for class a, declared in Listing 15.
所以到现在为止,赋值运算符复制了很多数据。
若要解决C2299,请不要使复制构造函数或赋值运算符成为模板函数,而使其成为采用类类型的非模板函数。
To resolve C2299, do not make the copy constructor or assignment operator a template function, but rather a non-template function that takes a class type.
若要解决C2299,请不要使复制构造函数或赋值运算符成为模板函数,而使其成为采用类类型的非模板函数。
To resolve C2299, do not make the copy constructor or assignment operator a template function, but rather a non-template function that takes a class type.
应用推荐