Created on 2016-06-17.00:00:00 last changed 90 months ago
Proposed resolution:
This wording is relative to N4606.
Edit [optional.nullopt]/2 as indicated:
[Drafting note: {} can do one of three things for a class type: it may be aggregate initialization, it may call a default constructor, or it may call an initializer-list constructor (see [dcl.init.list], [over.match.list]). The wording below forecloses all three possibilities. — end drafting note]
-2- Type nullopt_t shall not have a default constructor or an initializer-list constructor. It shall not be an aggregate and shall be a literal type. Constant nullopt shall be initialized with an argument of literal type.
[ 2016-08 Chicago ]
This is related to LWG 2510.
Monday PM: Ville to provide updated wording
Fri AM: Moved to Tentatively Ready
[optional.nullopt]/2 requires of nullopt_t that
Type nullopt_t shall not have a default constructor. It shall be a literal type. Constant nullopt shall be initialized with an argument of literal type.
This does not appear sufficient to foreclose the following implementation:
struct nullopt_t { constexpr nullopt_t(const nullopt_t&) = default; }; constexpr nullopt_t nullopt(nullopt_t{});
But such a nullopt_t is still constructible from {} and so still makes opt = {} ambiguous.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2016-11-14 03:59:28 | admin | set | status: pending -> wp |
2016-11-14 03:55:22 | admin | set | status: ready -> pending |
2016-08-06 20:44:18 | admin | set | status: new -> ready |
2016-08-01 18:34:48 | admin | set | messages: + msg8278 |
2016-07-19 03:46:55 | admin | set | messages: + msg8244 |
2016-06-17 00:00:00 | admin | create |