Created on 2016-07-20.00:00:00 last changed 90 months ago
Proposed resolution:
This wording is relative to N4600.
Wording relative to N4600 + LWG 2451, although it should be noted that this resolution should be applied wherever LWG 2451 is applied, be that to the fundamentals TS or the specification of optional in the C++ Working Paper.
In [optional.object.ctor], modify as indicated:
template <class U> constexpr optional(U&& v);[…]
-43- Remarks: If T's selected constructor is a constexpr constructor, this constructor shall be a constexpr constructor. This constructor shall not participate in overload resolution unless is_constructible_v<T, U&&> is true and decay_t<U> is not the same type as T. The constructor is explicit if and only if is_convertible_v<U&&, T> is false.
[ 2016-07 Chicago ]
Monday: P0 - tentatively ready
Addresses: fund.ts.v2
LWG 2451 adds a converting constructor to optional with signature:
template <class U> constexpr optional(U&& v);
and specifies that "This constructor shall not participate in overload resolution unless is_constructible_v<T, U&&> is true and U is not the same type as T." This suffices to avoid this constructor being selected by overload resolution for arguments that should match the move constructor, but not for arguments that should match the copy constructor. The recent churn around tuple's constructors suggests that we want this constructor to not participate in overload resolution if remove_cv_t<remove_reference_t<U>> is the same type as T.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:10:41 | admin | set | status: wp -> open |
2016-11-14 03:59:28 | admin | set | status: pending -> wp |
2016-11-14 03:55:22 | admin | set | status: ready -> pending |
2016-08-01 18:34:48 | admin | set | messages: + msg8288 |
2016-08-01 18:34:48 | admin | set | status: new -> ready |
2016-07-26 19:23:12 | admin | set | messages: + msg8257 |
2016-07-20 00:00:00 | admin | create |