[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](meta.type.synop#lib:is%5Fobject%5Fv "20.15.3 Header <type_­traits> synopsis [meta.type.synop]")<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.3 Concept equality_­comparable [concept.equalitycomparable]")<T>;

2

#

[Note 1:

The semiregular concept is modeled by types that behave similarly to built-in types like int, except that they might not be comparable with ==.

— _end note_]

3

#

[Note 2:

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

— _end note_]