Title
LWG-3703 was underly ambitious
Status
c++23
Section
[optional.optional.general][variant.variant.general]
Submitter
Casey Carter

Created on 2022-06-08.00:00:00 last changed 13 months ago

Messages

Date: 2022-07-25.20:32:58

Proposed resolution:

This wording is relative to N4910.

  1. Modify [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. 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.

    -2- Member val is provided for exposition only. When an optional<T> object contains a value, member val points to the contained value.

  2. Modify [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.

Date: 2022-07-25.00:00:00

[ 2022-07-25 Approved at July 2022 virtual plenary. Status changed: Ready → WP. ]

Date: 2022-07-15.00:00:00

[ 2022-07-15; LWG telecon: move to Ready ]

Date: 2022-06-15.00:00:00

[ 2022-06-21; Reflector poll ]

Set status to Tentatively Ready after nine votes in favour during reflector poll.

Date: 2022-06-08.00:00:00

LWG 3703 struck redundant language from [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.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2022-07-25 20:32:58adminsetmessages: + msg12650
2022-07-25 20:32:58adminsetstatus: ready -> wp
2022-07-25 20:28:19adminsetmessages: + msg12624
2022-06-21 11:47:28adminsetmessages: + msg12520
2022-06-21 11:47:28adminsetstatus: new -> ready
2022-06-11 14:12:45adminsetmessages: + msg12489
2022-06-08 00:00:00admincreate