optional
and over-aligned typesSection: 22.5.3 [optional.optional] Status: NAD Submitter: Tim Song Opened: 2017-09-04 Last modified: 2020-09-06
Priority: 3
View all other issues in [optional.optional].
View all issues with NAD status.
Discussion:
LWG issue 2555 added "It is implementation-defined whether over-aligned types are supported (C++14 §3.11)."
to the specification of std::experimental::optional
in LFTS, however that issue wasn't moved until optional
had
already been merged to the IS working paper, so it isn't present in the specification of std::optional
. Should the
same rule be added for std::optional
as well?
[2017-11 Albuquerque Wednesday night issues processing]
Priority set to 3; Casey to provide rationale for closing as NAD.
2018-11 Closed as NAD with the adoption of P0899R1
Proposed resolution:
This wording is relative to N4687.
Edit 22.5.3 [optional.optional] p1 as indicated:
[…] The contained value shall be allocated in a region of the
optional<T>
storage suitably aligned for the typeT
. It is implementation-defined whether over-aligned types are supported (6.7.6 [basic.align]). When an object of typeoptional<T>
is contextually converted tobool
, the conversion returnstrue
if the object contains a value; otherwise the conversion returnsfalse
.