Files
2025-10-25 03:02:53 +03:00

50 lines
3.1 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.

[concepts.object]
# 18 Concepts library [[concepts]](./#concepts)
## 18.6 Object concepts [concepts.object]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/concepts.tex#L1172)
This subclause describes concepts that specify the basis of the
value-oriented programming style on which the library is based[.](#1.sentence-1)
[🔗](#itemdecl:1)
`template<class T>
concept [movable](#concept:movable "18.6Object concepts[concepts.object]") = is_object_v<T> && [move_constructible](concept.moveconstructible#concept:move_constructible "18.4.13Concept move_­constructible[concept.moveconstructible]")<T> &&
[assignable_from](concept.assignable#concept:assignable_from "18.4.8Concept assignable_­from[concept.assignable]")<T&, T> && [swappable](concept.swappable#concept:swappable "18.4.9Concept swappable[concept.swappable]")<T>;
template<class T>
concept [copyable](#concept:copyable "18.6Object concepts[concepts.object]") = [copy_constructible](concept.copyconstructible#concept:copy_constructible "18.4.14Concept copy_­constructible[concept.copyconstructible]")<T> && [movable](#concept:movable "18.6Object concepts[concepts.object]")<T> && [assignable_from](concept.assignable#concept:assignable_from "18.4.8Concept assignable_­from[concept.assignable]")<T&, T&> &&
[assignable_from](concept.assignable#concept:assignable_from "18.4.8Concept assignable_­from[concept.assignable]")<T&, const T&> && [assignable_from](concept.assignable#concept:assignable_from "18.4.8Concept assignable_­from[concept.assignable]")<T&, const T>;
template<class T>
concept [semiregular](#concept:semiregular "18.6Object concepts[concepts.object]") = [copyable](#concept:copyable "18.6Object concepts[concepts.object]")<T> && [default_initializable](concept.default.init#concept:default_initializable "18.4.12Concept default_­initializable[concept.default.init]")<T>;
template<class T>
concept [regular](#concept:regular "18.6Object concepts[concepts.object]") = [semiregular](#concept:semiregular "18.6Object concepts[concepts.object]")<T> && [equality_comparable](concept.equalitycomparable#concept:equality_comparable "18.5.4Concept equality_­comparable[concept.equalitycomparable]")<T>;
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/concepts.tex#L1190)
[*Note [1](#note-1)*:
The [semiregular](#concept:semiregular "18.6Object concepts[concepts.object]") concept is modeled by types that behave similarly
to fundamental types like int, except that they need not
be comparable with ==[.](#2.sentence-1)
— *end note*]
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/concepts.tex#L1197)
[*Note [2](#note-2)*:
The [regular](#concept:regular "18.6Object concepts[concepts.object]") concept is modeled by types that behave similarly to
fundamental types like int and that are comparable with==[.](#3.sentence-1)
— *end note*]