Created on 2019-03-18.00:00:00 last changed 45 months ago
Proposed resolution:
This wording is relative to N4810.
In [utility.arg.requirements], edit Table 30 — "Cpp17Destructible requirements" as indicated:
Table 30 — Cpp17Destructible requirements Expression Post-condition u.~T() All resources owned by u are reclaimed, no exception is propagated. [Note: Array types and non-object types are not Cpp17Destructible. — end note]
Modify [optional.optional] as indicated:
-3- T shall be a
objecttype other than cv in_place_t or cv nullopt_tand shall satisfythat meets the Cpp17Destructible requirements (Table 30).
Modify [variant.variant] as indicated:
-2-All types in Types shall
be (possibly cv-qualified) object types that are not arraysmeet the Cpp17Destructible requirements (Table 30).
[ 2019-06-16 Moved to "Tentatively Ready" based on five positive votes on the reflector ]
[ 2019-03-26 Marshall provides updated resolution based on reflector discussion ]
[optional.optional] appears to allow arrays:
T shall be an object type other than cv in_place_t or cv nullopt_t and shall satisfy the Cpp17Destructible requirements (Table 30).
But instantiating it fails, because value_or attempts to return T by value, which isn't possible for an array type.
Existing practice seems to be to reject array types. Libstdc++ and libc++ give an error for the signature of value_or, and MSVC fails a static assert saying the type needs to be destructible (which is misleading, because int[2] is destructible, but either way it's ill-formed). Previous resolution [SUPERSEDED]:This wording is relative to N4810.
Modify [optional.optional] as indicated:
-3- T shall be a
nnon-array object type other than cv in_place_t or cv nullopt_t and shall satisfy the Cpp17Destructible requirements (Table 30).
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2019-07-22 15:46:37 | admin | set | status: voting -> wp |
2019-06-17 05:25:36 | admin | set | status: ready -> voting |
2019-06-16 19:32:21 | admin | set | messages: + msg10451 |
2019-06-16 19:32:21 | admin | set | status: new -> ready |
2019-03-26 14:12:25 | admin | set | messages: + msg10381 |
2019-03-19 19:16:08 | admin | set | messages: + msg10367 |
2019-03-18 00:00:00 | admin | create |