the only other thing to note in listing 17 is that the definitions for the copy constructor and operator= methods are not provided.
清单17中要注意的另一点是,未提供copy constructor和operator=方法的定义。
when it can do so, the compiler is permitted (but not obligated) to skip the copy constructor and create the object directly.
当这种用法被支持时,编译器被允许(但不被制强)跳过复制构造函数而直接创建该对象。
how to call to the copy constructor from the copy-assignment operator?
如何从复制赋值运算符调用复制构造函数?
if you need to make your class non-copyable, the typical way is to make the copy constructor and the assignment operator of the class private or protected.
如果您需要使类成为不可复制的,典型的实现方法是将类的复制构造函数和赋值运算符设置为private或protected。
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,请不要使复制构造函数或赋值运算符成为模板函数,而使其成为采用类类型的非模板函数。
the noncopyable class definition presents no surprises, as the copy constructor and operator= are declared private.
noncopyable类定义没有什么令人感到新奇的地方,因为copy constructor和operator=声明为private。
each class (whose instance will go into the container) must implement at least the copy constructor (it is good to implement also the assignment operator.class tmyclass
对需要保存到容器中的对象的类型来说,每个类都必须至少实现拷贝构造函数,最好还能重载赋值操作符。
why doesn't the copy constructor get called?
为什么不复制构造函数被调用?
the c++ standard allows for the copy constructor to be elided in certain situations.
标準的允许拷贝构造函数要省略在某些情况下。
each class (whose instance will go into the container) must implement at least the copy constructor (it is good to implement also the assignment operator.
每个类(其实例要在容器内使用)必须至少实现拷贝构造函数(实现赋值运算符,也是好习惯)。