Created on 2022-05-24.00:00:00 last changed 12 months ago
Proposed resolution:
This wording is relative to N4910.
[Drafting note: There is some drive-by cleanup that I couldn't resist while touching this wording: (1) strike the redundant "suitably aligned" guarantee, (2) Don't repeat in prose that the exposition-only members are exposition-only.]
Modify [expected.object.general] as indicated:
-1- Any object of type expected<T, E> either contains a value of type T or a value of type E within its own storage. Implementations are not permitted to use additional storage, such as dynamic memory, to allocate the object of type T or the object of type E.
These objects are allocated in a region of the expected<T, E> storage suitably aligned for the types T and E. Members has_val, val, and unex are provided for exposition only.Member has_val indicates whether the expected<T, E> object contains an object of type T.
Modify [expected.void.general] as indicated:
-?- Any object of type expected<T, E> either represents a value of type T, or contains a value of type E within its own storage. Implementations are not permitted to use additional storage, such as dynamic memory, to allocate the object of type E. Member has_val indicates whether the expected<T, E> object represents a value of type T.
-?- A program that instantiates the definition of the template expected<T, E> with a type for the E parameter that is not a valid template argument for unexpected is ill-formed. -1- E shall meet the requirements of Cpp17Destructible (Table [tab:cpp17.destructible]).
[ 2022-07-25 Approved at July 2022 virtual plenary. Status changed: Ready → WP. ]
[ 2022-07-15; LWG telecon: move to Ready ]
[ 2022-06-21; Reflector poll ]
Set status to Tentatively Ready after five votes in favour during reflector poll.
[ 2022-06-21; Reflector poll ]
Set priority to 2 after reflector poll.
[ 2022-06-21; Jonathan adds "Member" before "has_val" ]
The partial specialization expected<T, E> requires is_void<T> specified in [expected.void.general] is missing some template parameter requirements that should have been copied from [expected.object.general]. We should copy the pertinent requirements from the first two paragraphs of the latter subclause into new paragraphs in the first subclause (the pertinent requirement from the third paragraph is already present in [expected.void.general]).
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2022-07-25 20:32:58 | admin | set | messages: + msg12645 |
2022-07-25 20:32:58 | admin | set | status: ready -> wp |
2022-07-25 20:28:19 | admin | set | messages: + msg12619 |
2022-06-21 12:17:09 | admin | set | messages: + msg12527 |
2022-06-21 12:17:09 | admin | set | status: new -> ready |
2022-06-21 11:46:11 | admin | set | messages: + msg12512 |
2022-06-21 11:32:17 | admin | set | messages: + msg12510 |
2022-05-29 08:33:28 | admin | set | messages: + msg12478 |
2022-05-24 00:00:00 | admin | create |