Files
cppdraft_translate/cppdraft/concept/moveconstructible.md
2025-10-25 03:02:53 +03:00

35 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[concept.moveconstructible]
# 18 Concepts library [[concepts]](./#concepts)
## 18.4 Language-related concepts [[concepts.lang]](concepts.lang#concept.moveconstructible)
### 18.4.13 Concept move_constructible [concept.moveconstructible]
[🔗](#concept:move_constructible)
`template<class T>
concept [move_constructible](#concept:move_constructible "18.4.13Concept move_­constructible[concept.moveconstructible]") = [constructible_from](concept.constructible#concept:constructible_from "18.4.11Concept constructible_­from[concept.constructible]")<T, T> && [convertible_to](concept.convertible#concept:convertible_to "18.4.4Concept convertible_­to[concept.convertible]")<T, T>;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/concepts.tex#L800)
If T is an object type, then let rv be an rvalue of typeT and u2 a distinct object of type T equal torv[.](#1.sentence-1)
T models [move_constructible](#concept:move_constructible "18.4.13Concept move_­constructible[concept.moveconstructible]") only if
- [(1.1)](#1.1)
After the definition T u = rv;, u is equal to u2[.](#1.1.sentence-1)
- [(1.2)](#1.2)
T(rv) is equal to u2[.](#1.2.sentence-1)
- [(1.3)](#1.3)
If T is not const, rv's resulting state is valid
but unspecified ([[lib.types.movedfrom]](lib.types.movedfrom "16.4.6.17Moved-from state of library types")); otherwise, it is unchanged[.](#1.3.sentence-1)