34 lines
2.0 KiB
Markdown
34 lines
2.0 KiB
Markdown
[concept.copyconstructible]
|
||
|
||
# 18 Concepts library [[concepts]](./#concepts)
|
||
|
||
## 18.4 Language-related concepts [[concepts.lang]](concepts.lang#concept.copyconstructible)
|
||
|
||
### 18.4.14 Concept copy_constructible [concept.copyconstructible]
|
||
|
||
[ð](#concept:copy_constructible)
|
||
|
||
`template<class T>
|
||
concept [copy_constructible](#concept:copy_constructible "18.4.14 Concept copy_constructible [concept.copyconstructible]") =
|
||
[move_constructible](concept.moveconstructible#concept:move_constructible "18.4.13 Concept move_constructible [concept.moveconstructible]")<T> &&
|
||
[constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_from [concept.constructible]")<T, T&> && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_to [concept.convertible]")<T&, T> &&
|
||
[constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_from [concept.constructible]")<T, const T&> && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_to [concept.convertible]")<const T&, T> &&
|
||
[constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_from [concept.constructible]")<T, const T> && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_to [concept.convertible]")<const T, T>;
|
||
`
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/concepts.tex#L826)
|
||
|
||
If T is an object type, then let v be an lvalue of typeT or const T or an rvalue of type const T[.](#1.sentence-1)
|
||
|
||
T models [copy_constructible](#concept:copy_constructible "18.4.14 Concept copy_constructible [concept.copyconstructible]") only if
|
||
|
||
- [(1.1)](#1.1)
|
||
|
||
After the definition T u = v;,u is equal to v ([[concepts.equality]](concepts.equality "18.2 Equality preservation")) andv is not modified[.](#1.1.sentence-1)
|
||
|
||
- [(1.2)](#1.2)
|
||
|
||
T(v) is equal to v and does not modify v[.](#1.2.sentence-1)
|