This header is part of the
library.
Concepts
Core language concepts
(C++20)
specifies that a type is the same as another type
(concept)
(C++20)
specifies that a type is derived from another type
(concept)
(C++20)
specifies that a type is implicitly convertible to another type
(concept)
(C++20)
specifies that two types share a common reference type
(concept)
(C++20)
specifies that two types share a common type
(concept)
(C++20)
specifies that a type is an integral type
(concept)
(C++20)
specifies that a type is an integral type that is signed
(concept)
(C++20)
specifies that a type is an integral type that is unsigned
(concept)
(C++20)
specifies that a type is a floating-point type
(concept)
(C++20)
specifies that a type is assignable from another type
(concept)
(C++20)(C++20)
specifies that a type can be swapped or that two types can be swapped with each other
(concept)
(C++20)
specifies that an object of the type can be destroyed
(concept)
(C++20)
specifies that a variable of the type can be constructed from or bound to a set of argument types
(concept)
(C++20)
specifies that an object of a type can be default constructed
(concept)
(C++20)
specifies that an object of a type can be move constructed
(concept)
(C++20)
specifies that an object of a type can be copy constructed and move constructed
(concept)
Comparison concepts
equality_comparableequality_comparable_with
(C++20)(C++20)
specifies that operator == is an equivalence relation
(concept)
totally_orderedtotally_ordered_with
(C++20)(C++20)
specifies that the comparison operators on the type yield a total order
(concept)
Object concepts
(C++20)
specifies that an object of a type can be moved and swapped
(concept)
(C++20)
specifies that an object of a type can be copied, moved, and swapped
(concept)
(C++20)
specifies that an object of a type can be copied, moved, swapped, and default constructed
(concept)
(C++20)
specifies that a type is regular, that is, it is both
and
(concept)
Callable concepts
(C++20)(C++20)
specifies that a callable type can be invoked with a given set of argument types
(concept)
(C++20)
specifies that a callable type is a Boolean predicate
(concept)
(C++20)
specifies that a callable type is a binary relation
(concept)
(C++20)
specifies that a
imposes an equivalence relation
(concept)
(C++20)
specifies that a
imposes a strict weak ordering
(concept)
Customization point objects
(C++20)
swaps the values of two objects
(customization point object)
Synopsis
// all freestandingnamespacestd{// language-related concepts// concept same_astemplate<classT,classU>conceptsame_as=/* see description */;// concept derived_fromtemplate<classDerived,classBase>conceptderived_from=/* see description */;// concept convertible_totemplate<classFrom,classTo>conceptconvertible_to=/* see description */;// concept common_reference_withtemplate<classT,classU>conceptcommon_reference_with=/* see description */;// concept common_withtemplate<classT,classU>conceptcommon_with=/* see description */;// arithmetic conceptstemplate<classT>conceptintegral=/* see description */;template<classT>conceptsigned_integral=/* see description */;template<classT>conceptunsigned_integral=/* see description */;template<classT>conceptfloating_point=/* see description */;// concept assignable_fromtemplate<classLHS,classRHS>conceptassignable_from=/* see description */;// concept swappablenamespaceranges{inlinenamespace/* unspecified */{inlineconstexpr/* unspecified */swap=/* unspecified */;}}template<classT>conceptswappable=/* see description */;template<classT,classU>conceptswappable_with=/* see description */;// concept destructibletemplate<classT>conceptdestructible=/* see description */;// concept constructible_fromtemplate<classT,class...Args>conceptconstructible_from=/* see description */;// concept default_initializabletemplate<classT>conceptdefault_initializable=/* see description */;// concept move_constructibletemplate<classT>conceptmove_constructible=/* see description */;// concept copy_constructibletemplate<classT>conceptcopy_constructible=/* see description */;// comparison concepts// concept equality_comparabletemplate<classT>conceptequality_comparable=/* see description */;template<classT,classU>conceptequality_comparable_with=/* see description */;// concept totally_orderedtemplate<classT>concepttotally_ordered=/* see description */;template<classT,classU>concepttotally_ordered_with=/* see description */;// object conceptstemplate<classT>conceptmovable=/* see description */;template<classT>conceptcopyable=/* see description */;template<classT>conceptsemiregular=/* see description */;template<classT>conceptregular=/* see description */;// callable concepts// concept invocabletemplate<classF,class...Args>conceptinvocable=/* see description */;// concept regular_invocabletemplate<classF,class...Args>conceptregular_invocable=/* see description */;// concept predicatetemplate<classF,class...Args>conceptpredicate=/* see description */;// concept relationtemplate<classR,classT,classU>conceptrelation=/* see description */;// concept equivalence_relationtemplate<classR,classT,classU>conceptequivalence_relation=/* see description */;// concept strict_weak_ordertemplate<classR,classT,classU>conceptstrict_weak_order=/* see description */;}Helper concept
template<classT>concept/*boolean-testable-impl*/=convertible_to<T,bool>;// exposition only;template<classT>conceptboolean-testable=// exposition only/*boolean-testable-impl*/<T>&&requires(T&&t){{!std::forward<T>(t)}->/*boolean-testable-impl*/;};Concept
template<classT,classU>concept/*same-as-impl*/=is_same_v<T,U>;// exposition onlytemplate<classT,classU>conceptsame_as=/*same-as-impl*/<T,U>&&/*same-as-impl*/<U,T>;Concept
template<classDerived,classBase>conceptderived_from=is_base_of_v<Base,Derived>&&is_convertible_v<constvolatileDerived*,constvolatileBase*>;Concept
template<classFrom,classTo>conceptconvertible_to=is_convertible_v<From,To>&&requires{static_cast<To>(declval<From>());};Concept
template<classT,classU>conceptcommon_reference_with=same_as<common_reference_t<T,U>,common_reference_t<U,T>>&&convertible_to<T,common_reference_t<T,U>>&&convertible_to<U,common_reference_t<T,U>>;Concept
template<classT,classU>conceptcommon_with=same_as<common_type_t<T,U>,common_type_t<U,T>>&&requires{static_cast<common_type_t<T,U>>(declval<T>());static_cast<common_type_t<T,U>>(declval<U>());}&&common_reference_with<add_lvalue_reference_t<constT>,add_lvalue_reference_t<constU>>&&common_reference_with<add_lvalue_reference_t<common_type_t<T,U>>,common_reference_t<add_lvalue_reference_t<constT>,add_lvalue_reference_t<constU>>>;Concept
template<classT>conceptintegral=is_integral_v<T>;Concept
template<classT>conceptsigned_integral=integral<T>&&is_signed_v<T>;Concept
template<classT>conceptunsigned_integral=integral<T>&&!signed_integral<T>;Concept
template<classT>conceptfloating_point=is_floating_point_v<T>;Concept
template<classLHS,classRHS>conceptassignable_from=is_lvalue_reference_v<LHS>&&common_reference_with<constremove_reference_t<LHS>&,constremove_reference_t<RHS>&>&&requires(LHSlhs,RHS&&rhs){{lhs=std::forward<RHS>(rhs)}->same_as<LHS>;};Concept
template<classT>conceptswappable=requires(T&a,T&b){ranges::swap(a,b);};Concept
template<classT,classU>conceptswappable_with=common_reference_with<T,U>&&requires(T&&t,U&&u){ranges::swap(std::forward<T>(t),std::forward<T>(t));ranges::swap(std::forward<U>(u),std::forward<U>(u));ranges::swap(std::forward<T>(t),std::forward<U>(u));ranges::swap(std::forward<U>(u),std::forward<T>(t));};Concept
template<classT>conceptdestructible=is_nothrow_destructible_v<T>;Concept
template<classT,class...Args>conceptconstructible_from=destructible<T>&&is_constructible_v<T,Args...>;Concept
template<classT>constexprbool/*is-default-initializable*/=/* see description */;// exposition onlytemplate<classT>conceptdefault_initializable=constructible_from<T>&&requires{T{};}&&/*is-default-initializable*/<T>;Concept
template<classT>conceptmove_constructible=constructible_from<T,T>&&convertible_to<T,T>;Concept
template<classT>conceptcopy_constructible=move_constructible<T>&&constructible_from<T,T&>&&convertible_to<T&,T>&&constructible_from<T,constT&>&&convertible_to<constT&,T>&&constructible_from<T,constT>&&convertible_to<constT,T>;Concept
template<classT,classU>concept/*weakly-equality-comparable-with*/=// exposition onlyrequires(constremove_reference_t<T>&t,constremove_reference_t<U>&u){{t==u}->boolean-testable;{t!=u}->boolean-testable;{u==t}->boolean-testable;{u!=t}->boolean-testable;};template<classT>conceptequality_comparable=/*weakly-equality-comparable-with*/<T,T>;Concept
template<classT,classU,classC=common_reference_t<constT&,constU&>>concept/*comparison-common-type-with-impl*/=// exposition onlysame_as<common_reference_t<constT&,constU&>,common_reference_t<constU&,constT&>>&&requires{requiresconvertible_to<constT&,constC&>||convertible_to<T,constC&>;requiresconvertible_to<constU&,constC&>||convertible_to<U,constC&>;};template<classT,classU>concept/*comparison-common-type-with*/=// exposition only/*comparison-common-type-with-impl*/<remove_cvref_t<T>,remove_cvref_t<U>>;template<classT,classU>conceptequality_comparable_with=equality_comparable<T>&&equality_comparable<U>&&/*comparison-common-type-with*/<T,U>&&equality_comparable<common_reference_t<constremove_reference_t<T>&,constremove_reference_t<U>&>>&&/*weakly-equality-comparable-with*/<T,U>;Helper concept
Defined in header
template<classT,classU>concept/*partially-ordered-with*/=// exposition onlyrequires(constremove_reference_t<T>&t,constremove_reference_t<U>&u){{t<u}->boolean-testable;{t>u}->boolean-testable;{t<=u}->boolean-testable;{t>=u}->boolean-testable;{u<t}->boolean-testable;{u>t}->boolean-testable;{u<=t}->boolean-testable;{u>=t}->boolean-testable;};Concept
template<classT>concepttotally_ordered=equality_comparable<T>&&/*partially-ordered-with*/<T,T>;Concept
template<classT,classU>concepttotally_ordered_with=totally_ordered<T>&&totally_ordered<U>&&equality_comparable_with<T,U>&&totally_ordered<common_reference_t<constremove_reference_t<T>&,constremove_reference_t<U>&>>&&/*partially-ordered-with*/<T,U>;Concept
template<classT>conceptmovable=is_object_v<T>&&move_constructible<T>&&assignable_from<T&,T>&&swappable<T>;Concept
template<classT>conceptcopyable=copy_constructible<T>&&movable<T>&&assignable_from<T&,T&>&&assignable_from<T&,constT&>&&assignable_from<T&,constT>;Concept
template<classT>conceptsemiregular=copyable<T>&&default_initializable<T>;Concept
template<classT>conceptregular=semiregular<T>&&equality_comparable<T>;Concept
template<classF,class...Args>conceptinvocable=requires(F&&f,Args&&...args){invoke(std::forward<F>(f),std::forward<Args>(args)...);// not required to be equality-preserving};Concept
template<classF,class...Args>conceptregular_invocable=invocable<F,Args...>;Concept
template<classF,class...Args>conceptpredicate=regular_invocable<F,Args...>&&boolean-testable<invoke_result_t<F,Args...>>;Concept
template<classR,classT,classU>conceptrelation=predicate<R,T,T>&&predicate<R,U,U>&&predicate<R,T,U>&&predicate<R,U,T>;Concept
template<classR,classT,classU>conceptequivalence_relation=relation<R,T,U>;Concept
template<classR,classT,classU>conceptstrict_weak_order=relation<R,T,U>;