20 General utilities library [utilities]

20.14 Function objects [function.objects]

20.14.6 Class template reference_­wrapper [refwrap]

20.14.6.1 General [refwrap.general]

namespace std { template<class T> class reference_wrapper { public: // types using type = T; // construct/copy/destroy template<class U> constexpr reference_wrapper(U&&) noexcept(see below); constexpr reference_wrapper(const reference_wrapper& x) noexcept; // assignment constexpr reference_wrapper& operator=(const reference_wrapper& x) noexcept; // access constexpr operator T& () const noexcept; constexpr T& get() const noexcept; // invocation template<class... ArgTypes> constexpr invoke_result_t<T&, ArgTypes...> operator()(ArgTypes&&...) const; }; template<class T> reference_wrapper(T&) -> reference_wrapper<T>; }
reference_­wrapper<T> is a Cpp17CopyConstructible and Cpp17CopyAssignable wrapper around a reference to an object or function of type T.
reference_­wrapper<T> is a trivially copyable type.
The template parameter T of reference_­wrapper may be an incomplete type.