This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.
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 type T with the arguments std::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 type T with the arguments il, 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 type TI with the arguments std::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 type TI with the arguments il, 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 type T with the arguments std::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 type T with the arguments il, 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 type TI with the arguments std::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 type TI with the arguments il, std::forward(args)....
Modify 22.6.3.5 [variant.mod] paragraph 6 as indicated:
Effects: Destroys the currently contained value if valueless_by_exception() is false. Thendirect-initializes the contained value as if direct-non-list-initializingconstructinga value of type TI with the arguments std::forward<Args>(args)....
Modify 22.6.3.5 [variant.mod] paragraph 11 as indicated:
Effects: Destroys the currently contained value if valueless_by_exception() is false. Thendirect-initializes the contained value as if direct-non-list-initializingconstructinga value of type TI with the arguments il, std::forward<Args>(args)....