1.7 KiB
1.7 KiB
[refwrap.const]
22 General utilities library [utilities]
22.10 Function objects [function.objects]
22.10.6 Class template reference_wrapper [refwrap]
22.10.6.2 Constructors [refwrap.const]
template<class U> constexpr reference_wrapper(U&& u) noexcept(see below);
Let FUN denote the exposition-only functionsvoid FUN(T&) noexcept;void FUN(T&&) = delete;
Constraints: The expression FUN(declval()) is well-formed andis_same_v<remove_cvref_t, reference_wrapper> is false.
Effects: Creates a variable r as if by T& r = std::forward(u), then constructs a reference_wrapper object that stores a reference to r.
Remarks: The exception specification is equivalent tonoexcept(FUN(declval())).
constexpr reference_wrapper(const reference_wrapper& x) noexcept;
Effects: Constructs a reference_wrapper object that stores a reference to x.get().