2307. Should the Standard Library use explicit only when necessary?

Section: 24 [containers] Status: LEWG Submitter: Zhihao Yuan Opened: 2013-09-26 Last modified: 2018-11-12 05:21:03 UTC

Priority: 2

View other active issues in [containers].

View all other issues in [containers].

View all issues with LEWG status.


LWG 2193 yields explicit for default ctors to allow {}, but not for all cases of uniform initialization. For example:

explicit vector(size_type count, const Allocator& alloc = Allocator());

This prevents {n, alloc()}. Although this use is relatively rare, but the behavior is inconsistent with that of

vector(size_type count, const T& value, const Allocator& alloc = Allocator());

[Urbana 2014-11-07: Move to Open]

[2018-08 Batavia Monday issue discussion]

This really needs a paper; splitting a lot of constructors. Nevin to write paper.

[2018-11 San Diego Thursday night issue processing]

LEWG has rejected Nevin's paper, so they need to formulate a policy.

Proposed resolution: