Files
cppdraft_translate/cppdraft/refwrap/const.md
2025-10-25 03:02:53 +03:00

1.7 KiB
Raw Blame History

[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);

1

#

Let FUN denote the exposition-only functionsvoid FUN(T&) noexcept;void FUN(T&&) = delete;

2

#

Constraints: The expression FUN(declval()) is well-formed andis_same_v<remove_cvref_t, reference_wrapper> is false.

3

#

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.

4

#

Remarks: The exception specification is equivalent tonoexcept(FUN(declval())).

🔗

constexpr reference_wrapper(const reference_wrapper& x) noexcept;

5

#

Effects: Constructs a reference_wrapper object that stores a reference to x.get().