Title
in_place_t check for optional::optional(U&&) should decay U
Status
c++17
Section
[optional.ctor]
Submitter
Tim Song

Created on 2016-12-13.00:00:00 last changed 89 months ago

Messages

Date: 2017-01-30.15:36:02

Proposed resolution:

This wording is relative to N4618.

  1. Edit [optional.ctor] as indicated:

    template <class U = T>
      EXPLICIT constexpr optional(U&& v);
    

    […]

    -22- 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, is_same_v<decay_t<U>, in_place_t> is false, and is_same_v<optional<T>, decay_t<U>> is false. The constructor is explicit if and only if is_convertible_v<U&&, T> is false.

Date: 2017-01-27.00:00:00

[ 2017-01-27 Telecon ]

Priority 0

Date: 2016-12-13.00:00:00

As in_place_t is a normal tag type again, we need to decay U before doing the is_same_v check.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2017-03-05 23:41:16adminsetstatus: ready -> wp
2017-01-30 15:36:02adminsetmessages: + msg8818
2017-01-30 15:36:02adminsetstatus: new -> ready
2016-12-18 13:50:43adminsetmessages: + msg8766
2016-12-13 00:00:00admincreate