Created on 2018-07-10.00:00:00 last changed 12 months ago
Proposed resolution:
This wording is relative to N4885.
Change [refwrap.helpers] as indicated:
template<class T> constexpr reference_wrapper<T> ref(reference_wrapper<T> t) noexcept;[…]-3- Returns:
ref(t.get())t.template<class T> constexpr reference_wrapper<const T> cref(reference_wrapper<T> t) noexcept;-5- Returns:
cref(t.get())t.
[ 2021-10-14 Approved at October 2021 virtual plenary. Status changed: Voting → WP. ]
[ 2021-08-20; LWG telecon ]
Set status to Tentatively Ready after telecon review.
[ 2021-05-22 Tim syncs wording to the current working draft ]
[ 2018-08-20 Priority set to 3 after reflector discussion ]
The overloads of std::ref/cref that take a reference_wrapper as argument are defined as calling std::ref/cref recursively, whereas the return type is defined as unwrapping just one level. Calling these functions with arguments of multiple level of wrapping leads to ill-formed programs:
int i = 0; std::reference_wrapper<int> ri(i); std::reference_wrapper<std::reference_wrapper<int>> rri(ri); std::ref(rri); // error within 'std::ref'
[Note: these overloads were added by issue resolution 10.29 for TR1, which can be found at N1688, at Redmond 2004]
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2021-10-14 09:56:08 | admin | set | messages: + msg12112 |
2021-10-14 09:56:08 | admin | set | status: voting -> wp |
2021-09-29 12:57:28 | admin | set | status: ready -> voting |
2021-08-20 17:21:40 | admin | set | messages: + msg12009 |
2021-08-20 17:21:40 | admin | set | status: new -> ready |
2021-05-22 14:52:08 | admin | set | messages: + msg11837 |
2018-08-22 12:55:05 | admin | set | messages: + msg10097 |
2018-07-30 20:47:23 | admin | set | messages: + msg10050 |
2018-07-10 00:00:00 | admin | create |