[concepts.object] (original) (raw)

18 Concepts library [concepts]

1

#

This subclause describes concepts that specify the basis of the value-oriented programming style on which the library is based.

🔗

template<class T> concept [movable](#concept:movable "18.6 Object concepts [concepts.object]") = is_object_v<T> && [move_constructible](concept.moveconstructible#concept:move%5Fconstructible "18.4.13 Concept move_­constructible [concept.moveconstructible]")<T> && [assignable_from](concept.assignable#concept:assignable%5Ffrom "18.4.8 Concept assignable_­from [concept.assignable]")<T&, T> && [swappable](concept.swappable#concept:swappable "18.4.9 Concept swappable [concept.swappable]")<T>;template<class T> concept [copyable](#concept:copyable "18.6 Object concepts [concepts.object]") = [copy_constructible](concept.copyconstructible#concept:copy%5Fconstructible "18.4.14 Concept copy_­constructible [concept.copyconstructible]")<T> && [movable](#concept:movable "18.6 Object concepts [concepts.object]")<T> && [assignable_from](concept.assignable#concept:assignable%5Ffrom "18.4.8 Concept assignable_­from [concept.assignable]")<T&, T&> && [assignable_from](concept.assignable#concept:assignable%5Ffrom "18.4.8 Concept assignable_­from [concept.assignable]")<T&, const T&> && [assignable_from](concept.assignable#concept:assignable%5Ffrom "18.4.8 Concept assignable_­from [concept.assignable]")<T&, const T>;template<class T> concept [semiregular](#concept:semiregular "18.6 Object concepts [concepts.object]") = [copyable](#concept:copyable "18.6 Object concepts [concepts.object]")<T> && [default_initializable](concept.default.init#concept:default%5Finitializable "18.4.12 Concept default_­initializable [concept.default.init]")<T>;template<class T> concept [regular](#concept:regular "18.6 Object concepts [concepts.object]") = [semiregular](#concept:semiregular "18.6 Object concepts [concepts.object]")<T> && [equality_comparable](concept.equalitycomparable#concept:equality%5Fcomparable "18.5.4 Concept equality_­comparable [concept.equalitycomparable]")<T>;

2

#

[Note 1:

The semiregular concept is modeled by types that behave similarly to fundamental types like int, except that they need not be comparable with ==.

— _end note_]

3

#

[Note 2:

The regular concept is modeled by types that behave similarly to fundamental types like int and that are comparable with==.

— _end note_]