C++ 概念: CopyConstructible
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
指定的类型的一个实例可以复制构造(复制).
原文:
Specifies that an instance of the type can be copy-constructed (copied).
这个概念意味着
MoveConstructible.原文:
This concept implies
MoveConstructible.[编辑] 要求
该类型必须实现以下功能:1
原文:
The type must implement the following functions:
Type::Type
| Type::Type( Type& other ); Type::Type( const Type& other ); |
(的变种之一就足够了) | |
拷贝构造函数: constructs an instance of a type with the contents of other. The internal state of other is not modified.
The following expressions must have the specified effects:
| 表达
|
Effects |
| Type a = v; | a是相当于v,rvType是一个实例。 v必须保持不变.原文: a is equivalent to v, where rv is an instance of Type. v must be unchanged. |
| Type(v); | Type是一个实例vv,相当于一个临时对象类型Type。 v必须保持不变. 原文: a temporary object of type Type is equivalent to v, where v is an instance of Type. v must be unchanged. |
[编辑] 另请参阅
| (C++11) (C++11) (C++11) |
检查对象是否声明了拷贝构造函数 (类模板) |