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

Section: 26 [containers] Status: Open Submitter: Zhihao Yuan Opened: 2013-09-26 Last modified: 2016-02-10

Priority: 2

View other active issues in [containers].

View all other issues in [containers].

View all issues with Open 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]

Proposed resolution: