Title
Unnecessary decay in reference_wrapper
Status
c++20
Section
[refwrap.const]
Submitter
Agustín K-ballo Bergé

Created on 2017-12-04.00:00:00 last changed 38 months ago

Messages

Date: 2018-03-18.16:03:30

Proposed resolution:

This wording is relative to N4713.

  1. Change [refwrap.const] as indicated:

    template<class U>
    reference_wrapper(U&& u) noexcept(see below);

    -1- Remarks: Let FUN denote the exposition-only functions

    void FUN(T&) noexcept;
    void FUN(T&&) = delete;
    

    This constructor shall not participate in overload resolution unless the expression FUN(declval<U>()) is well-formed and is_same_v<decay_tremove_cvref_t<U>, reference_wrapper> is false. The expression inside noexcept is equivalent to noexcept(FUN(declval<U>())).

Date: 2018-03-17.00:00:00

[ 2018-3-17 Adopted in Jacksonville ]

Date: 2018-01-09.00:00:00

[ 2018-01-09 Moved to Tentatively Ready after 9 positive votes on c++std-lib. ]

Date: 2017-12-04.00:00:00

Another occurrence of unnecessary decay (P0777) was introduced by the resolution of LWG 2993. A decayed function/array type will never be the same type as reference_wrapper.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2018-03-18 16:03:30adminsetmessages: + msg9750
2018-03-18 16:03:30adminsetstatus: voting -> wp
2018-02-12 01:13:49adminsetstatus: ready -> voting
2018-01-11 17:24:32adminsetmessages: + msg9602
2018-01-11 17:24:32adminsetstatus: new -> ready
2017-12-05 20:57:50adminsetmessages: + msg9579
2017-12-04 00:00:00admincreate