Section: 22.6.3.2 [variant.ctor] Status: C++17 Submitter: United States Opened: 2017-02-03 Last modified: 2020-09-06
Priority: Not Prioritized
View other active issues in [variant.ctor].
View all other issues in [variant.ctor].
View all issues with C++17 status.
Discussion:
Addresses US 118The form of initialization for the emplace-constructors is not specified. We are very clear to mandate "as if by direct
non-list initialization" for each constructor in optional
, so there is no ambiguity regarding parens vs. braces.
That wording idiom should be followed by variant
.
Proposed change: Insert the phrase "as if direct-non-list-initializing" at appropriate locations in paragraphs 19, 23, 27, and 31
[2017-02-20, Marshall adds wording]
[2017-02-27, Marshall adds wording to cover two more cases]
Previous resolution [SUPERSEDED]:
This wording is relative to N4640.
Modify 22.6.3.2 [variant.ctor] paragraph 19 as indicated:
Effects: Initializes the contained value as if direct-non-list-initializing an object of typeT
with the argumentsstd::forward<Args>(args)...
.Modify 22.6.3.2 [variant.ctor] paragraph 23 as indicated:
Effects: Initializes the contained value as if direct-non-list-initializingconstructingan object of typeT
with the argumentsil, std::forward<Args>(args)...
.Modify 22.6.3.2 [variant.ctor] paragraph 27 as indicated:
Effects: Initializes the contained value as if direct-non-list-initializingconstructingan object of typeTI
with the argumentsstd::forward<Args>(args)...
.Modify 22.6.3.2 [variant.ctor] paragraph 31 as indicated:
Effects: Initializes the contained value as if direct-non-list-initializingconstructingan object of typeTI
with the argumentsil, std::forward(args)...
.
[Kona 2017-02-28]
Accepted as Immediate to resolve NB comment.
Proposed resolution:
This wording is relative to N4640.
Modify 22.6.3.2 [variant.ctor] paragraph 19 as indicated:
Effects: Initializes the contained value as if direct-non-list-initializing an object of typeT
with the argumentsstd::forward<Args>(args)...
.
Modify 22.6.3.2 [variant.ctor] paragraph 23 as indicated:
Effects: Initializes the contained value as if direct-non-list-initializingconstructingan object of typeT
with the argumentsil, std::forward<Args>(args)...
.
Modify 22.6.3.2 [variant.ctor] paragraph 27 as indicated:
Effects: Initializes the contained value as if direct-non-list-initializingconstructingan object of typeTI
with the argumentsstd::forward<Args>(args)...
.
Modify 22.6.3.2 [variant.ctor] paragraph 31 as indicated:
Effects: Initializes the contained value as if direct-non-list-initializingconstructingan object of typeTI
with the argumentsil, std::forward(args)...
.
Modify 22.6.3.5 [variant.mod] paragraph 6 as indicated:
Effects: Destroys the currently contained value ifvalueless_by_exception()
is false. Thendirect-initializes the contained value as if direct-non-list-initializingconstructinga value of typeTI
with the argumentsstd::forward<Args>(args)...
.
Modify 22.6.3.5 [variant.mod] paragraph 11 as indicated:
Effects: Destroys the currently contained value ifvalueless_by_exception()
is false. Thendirect-initializes the contained value as if direct-non-list-initializingconstructinga value of typeTI
with the argumentsil, std::forward<Args>(args)...
.