optional
Section: 5.3 [fund.ts.v2::optional.object] Status: TS Submitter: Marshall Clow Opened: 2015-11-03 Last modified: 2018-07-08
Priority: 0
View all other issues in [fund.ts.v2::optional.object].
View all issues with TS status.
Discussion:
Addresses: fund.ts.v2
22.5.3 [optional.optional] does not specify whether over-aligned types are supported. In other places where we specify allocation of user-supplied types, we state that "It is implementation-defined whether over-aligned types are supported (3.11)." (Examples: 7.6.2.8 [expr.new]/p1, 20.2.10.2 [allocator.members]/p5, [temporary.buffer]/p1). We should presumably do the same thing here.
Proposed resolution:
This wording is relative to N4562.
Edit 22.5.3 [optional.optional]/p1 as follows::
[…] 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 (C++14 §3.11). When an object of typeoptional<T>
is contextually converted tobool
, the conversion returnstrue
if the object contains a value; otherwise the conversion returnsfalse
.