2555. [fund.ts.v2] No handling for over-aligned types in optional

Section: 99 [fund.ts.v2::optional.optional] Status: TS Submitter: Marshall Clow Opened: 2015-11-03 Last modified: 2017-07-30

Priority: 0

View all other issues in [fund.ts.v2::optional.optional].

View all issues with TS status.

Discussion:

Addresses: fund.ts.v2

99 [fund.ts.v2::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: 8.5.2.4 [expr.new]/p1, 23.10.10.1 [allocator.members]/p5, [temporary.buffer]/p1). We should presumably do the same thing here.

Proposed resolution:

This wording is relative to N4562.

  1. Edit 99 [fund.ts.v2::optional.optional]/p1 as follows::

    […] The contained value shall be allocated in a region of the optional<T> storage suitably aligned for the type T. It is implementation-defined whether over-aligned types are supported (C++14 §3.11). 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.