[refwrap.general] (original) (raw)

22 General utilities library [utilities]

22.10 Function objects [function.objects]

22.10.6 Class template reference_wrapper [refwrap]

22.10.6.1 General [refwrap.general]

namespace std { template<class T> class reference_wrapper { public: using type = T;template<class U> constexpr reference_wrapper(U&&) noexcept(see below);constexpr reference_wrapper(const reference_wrapper& x) noexcept;constexpr reference_wrapper& operator=(const reference_wrapper& x) noexcept;constexpr operator T& () const noexcept;constexpr T& get() const noexcept;template<class... ArgTypes> constexpr invoke_result_t<T&, ArgTypes...> operator()(ArgTypes&&...) const noexcept(is_nothrow_invocable_v<T&, ArgTypes...>);friend constexpr bool operator==(reference_wrapper, reference_wrapper);friend constexpr bool operator==(reference_wrapper, const T&);friend constexpr bool operator==(reference_wrapper, reference_wrapper<const T>);friend constexpr auto operator<=>(reference_wrapper, reference_wrapper);friend constexpr auto operator<=>(reference_wrapper, const T&);friend constexpr auto operator<=>(reference_wrapper, reference_wrapper<const T>);};template<class T> reference_wrapper(T&) -> reference_wrapper<T>;}

The template parameter T of reference_wrappermay be an incomplete type.