|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Old binders and adaptors | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
| Non-member functions | ||||
(C++26)(C++26) | ||||
| Deduction guides(C++17) | ||||
| Helper classes | ||||
basic_common_reference<std::reference_wrapper> (C++23) |
Defined in header <functional> | ||
template<class R,class T, template<class> RQual,template<class> TQual> | (1) | (since C++23) |
template<class T,class R, template<class> TQual,template<class> RQual> | (2) | (since C++23) |
Helper concepts | ||
template<class R,class T,class RQ,class TQ> concept/*ref-wrap-common-reference-exists-with*/= | (3) | (exposition only*) |
The common reference type of areference_wrapper (denoted asR) and a typeT, correspondingly applied with cv and reference qualifiers (denoted asRQ andTQ respectively), is equivalent to a common reference type of underlying type ofR applied with lvalue reference and theTQ.
The common reference type is defined only ifR is the onlyreference_wrapper, the underlying type ofR applied with lvalue reference and theTQ have a common reference type to whichRQ must be convertible.
The exposition-only constant/*is-ref-wrapper*/<R> istrue if and only ifR is a specialization ofstd::reference_wrapper.
Contents |
| Member type | Definition |
type | std::common_reference_t<typename R::type&, TQual<T>>(1,2) |
| Feature-test macro | Value | Std | Feature |
|---|---|---|---|
__cpp_lib_common_reference_wrapper | 202302L | (C++23) | Makestd::common_reference_t ofstd::reference_wrapper a reference type |
#include <concepts>#include <functional> static_assert(std::same_as<std::common_reference_t<int&,std::reference_wrapper<int>>,int&>);static_assert(std::same_as<std::common_reference_t<std::reference_wrapper<int>&,int&>,int&>);static_assert(std::same_as<std::common_reference_t<int&,conststd::reference_wrapper<int>&>,int&>);int main(){}
| determines the common reference type of a group of types (class template)[edit] |