std::movable - cppreference.com (original) (raw)
From cppreference.com
Core language concepts same_as(C++20) derived_from(C++20) convertible_to(C++20) common_reference_with(C++20) common_with(C++20) integral(C++20) signed_integral(C++20) unsigned_integral(C++20) floating_point(C++20) swappableswappable_with(C++20)(C++20) destructible(C++20) constructible_from(C++20) default_initializable(C++20) move_constructible(C++20) copy_constructible(C++20) assignable_from(C++20) | Comparison concepts equality_comparableequality_comparable_with(C++20)(C++20) totally_orderedtotally_ordered_with(C++20)(C++20) Object concepts movable(C++20) copyable(C++20) semiregular(C++20) regular(C++20) Callable concepts invocableregular_invocable(C++20)(C++20) predicate(C++20) relation(C++20) equivalence_relation(C++20) strict_weak_order(C++20) |
---|
Exposition-only concepts |
---|
boolean-testable (C++20) |
| Defined in header | | | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ------------- | | template< class T > concept movable = std::is_object_v<T> && std::move_constructible<T> && std::assignable_from<T&, T> && std::swappable<T>; | | (since C++20) |
The concept movable<T>
specifies that T
is an object type that can be moved (that is, it can be move constructed, move assigned, and lvalues of type T
can be swapped).
[edit] References
C++23 standard (ISO/IEC 14882:2024):
18.6 Object concepts [concepts.object]
C++20 standard (ISO/IEC 14882:2020):
18.6 Object concepts [concepts.object]
[edit] See also
copyable(C++20) | specifies that an object of a type can be copied, moved, and swapped (concept) [edit] |
---|
Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/concepts/movable&oldid=177896"