L
Luke Allardyce
As seen here
https://groups.google.com/a/isocpp.org/forum/?fromgroups#!topic/std-discussion/J7JKWHr0YRM
It appears that N3691 and later drafts (including the latest N3936) have modified the constructors for vector<bool>
Pre-N3691:
....
explicit vector(size_type n, const bool& value = bool(), const Allocator&= Allocator());
....
Currently:
....
explicit vector(size_type n, const Allocator& = Allocator());
vector(size_type n, const bool& value, const Allocator& = Allocator());
....
The first constructor for the current draft requires that the elements are default-inserted according to [container.requirements.general]:
An element of X is default-inserted if it is initialized by evaluation of the expression allocator_traits<A>::construct(m, p)
vector<bool> does not use allocator_traits::construct to construct these elements however, and it is unclear how they are inserted. Presumably the intent is to insert elements that are zero-initialized (i.e. false) if using the default Allocator, but this doesn't seem to be guaranteed.
Could this be an editing error or does vector<bool> need further clarification?
https://groups.google.com/a/isocpp.org/forum/?fromgroups#!topic/std-discussion/J7JKWHr0YRM
It appears that N3691 and later drafts (including the latest N3936) have modified the constructors for vector<bool>
Pre-N3691:
....
explicit vector(size_type n, const bool& value = bool(), const Allocator&= Allocator());
....
Currently:
....
explicit vector(size_type n, const Allocator& = Allocator());
vector(size_type n, const bool& value, const Allocator& = Allocator());
....
The first constructor for the current draft requires that the elements are default-inserted according to [container.requirements.general]:
An element of X is default-inserted if it is initialized by evaluation of the expression allocator_traits<A>::construct(m, p)
vector<bool> does not use allocator_traits::construct to construct these elements however, and it is unclear how they are inserted. Presumably the intent is to insert elements that are zero-initialized (i.e. false) if using the default Allocator, but this doesn't seem to be guaranteed.
Could this be an editing error or does vector<bool> need further clarification?