Section: 126.96.36.199 [optional.optional.general], 188.8.131.52 [variant.variant.general] Status: WP Submitter: Casey Carter Opened: 2022-06-08 Last modified: 2022-07-25 20:32:58 UTC
Priority: Not Prioritized
View all other issues in [optional.optional.general].
View all issues with WP status.
LWG 3703 struck redundant language from 184.108.40.206 [expected.void.general] specifying that (1) space allocated for an object is suitably aligned, and (2) a member annotated // exposition only in a class synopsis "is provided for exposition only."Let's also strike similar occurrences from the wording for optional and variant.
[2022-06-21; Reflector poll]
Set status to Tentatively Ready after nine votes in favour during reflector poll.
[2022-07-15; LWG telecon: move to Ready]
[2022-07-25 Approved at July 2022 virtual plenary. Status changed: Ready → WP.]
This wording is relative to N4910.
Modify 220.127.116.11 [optional.optional.general] as indicated:
-1- Any instance of optional<T> at any given time either contains a value or does not contain a value. When an instance of optional<T> contains a value, it means that an object of type T, referred to as the optional object's contained value, is allocated within the storage of the optional object. Implementations are not permitted to use additional storage, such as dynamic memory, to allocate its contained value.-2-
The contained value shall be allocated in a region of the optional<T> storage suitably aligned for the type T.When an object of type optional<T> is contextually converted to bool, the conversion returns true if the object contains a value; otherwise the conversion returns false. Member val is provided for exposition only.When an optional<T> object contains a value, val points to the contained value.
Modify 18.104.22.168 [variant.variant.general] as indicated:
-1- Any instance of variant at any given time either holds a value of one of its alternative types or holds no value. When an instance of variant holds a value of alternative type T, it means that a value of type T, referred to as the variant object's contained value, is allocated within the storage of the variant object. Implementations are not permitted to use additional storage, such as dynamic memory, to allocate the contained value.
The contained value shall be allocated in a region of the variant storage suitably aligned for all types in Types.