Created on 2017-05-31.00:00:00 last changed 31 months ago
This wording is relative to N4727.
Modify [variant.visit] as indicated:
template<class Visitor, class... Variants> constexpr see below visit(Visitor&& vis, Variants&&... vars);
[…]-3- Returns: e(m), where m is the pack for which mi is varsi.index() for all 0 <= i < n. The return type is
the type of e(m). […]
[ 2018-06 Rapperswil: Adopted ]
[ 2018-02-23 Moved to Tentatively Ready after 6 positive votes on c++std-lib. ]
[ 2017-01-24, Daniel comments ]
This issue should be reviewed in common with LWG 3052.
[ 2018-01-11, Thomas Köppe comments and suggests wording ]
The return type of std::visit (originating by P0088R3 accepted during the Oulo 2016 meeting) is currently misspecified and refers only to the common type of all the possible visitation calls, without attention to the value category. This seems unintended, and we should preserve the value category.
[ 2017-07 Toronto Monday issue prioritization ]
Priority 2; Matt to provide wording
[variant.visit]/1 correctly uses "type and value category", but then p3 describes the return type of visit to be "the common type of all possible INVOKE expressions of the Effects: element." The type of an expression is never a reference type, due to [expr]/5 removing the referenceness "prior to any further analysis", so this wording as written says that visit always returns a non-reference type, which is presumably not the intent.
|2021-02-25 10:48:01||admin||set||status: wp -> c++20|
|2018-06-12 01:05:16||admin||set||messages: + msg9880|
|2018-06-12 01:05:16||admin||set||status: voting -> wp|
|2018-05-06 19:23:13||admin||set||status: ready -> voting|
|2018-03-03 17:19:23||admin||set||messages: + msg9699|
|2018-03-03 17:19:23||admin||set||status: new -> ready|
|2018-01-24 20:29:21||admin||set||messages: + msg9629|
|2018-01-14 13:56:30||admin||set||messages: + msg9607|
|2018-01-14 13:56:30||admin||set||messages: + msg9606|
|2017-07-12 01:30:31||admin||set||messages: + msg9337|