Title
Standard library needs review for constructors to be explicit to avoid treatment as initializer-list constructor
Status
nad
Section
[library][thread][depr]
Submitter
LWG

Created on 2009-06-28.00:00:00 last changed 163 months ago

Messages

Date: 2010-10-21.18:28:33

Rationale:

We are unaware of any cases where initializer lists cause problem in this context, but if problems arise in the future the issue can be reopened.

Date: 2010-10-21.18:28:33

[ 2010 Pittsburgh: Moved to NAD, rationale added below. ]

Date: 2010-10-21.18:28:33

[ 2009 Santa Cruz: ]

Move to "Open". Robert Klarer has promised to provide wording.

Date: 2009-06-28.00:00:00

Addresses DE 2

Description

Marking a constructor with explicit has semantics even for a constructor with zero or several parameters: Such a constructor cannot be used with list-initialization in a copy-initialization context, see [over.match.list]. The standard library apparently has not been reviewed for marking non-single-parameter constructors as explicit.

Suggestion

Consider marking zero-parameter and multi-parameter constructors explicit in classes that have at least one constructor marked explicit and that do not have an initializer-list constructor.

Notes

Robert Klarer to address this one.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg933
2010-10-21 18:28:33adminsetmessages: + msg932
2010-10-21 18:28:33adminsetmessages: + msg931
2009-06-28 00:00:00admincreate