2187. vector<bool> is missing emplace and emplace_back member functions

Section: 26.3.12 [vector.bool] Status: C++14 Submitter: Nevin Liber Opened: 2012-09-21 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [vector.bool].

View all issues with C++14 status.


It should have them so that it more closely matches the vector<T> interface, as this helps when writing generic code.

[2012, Portland: Move to Tentatively Ready]

Question on whether the variadic template is really needed, but it turns out to be needed to support emplace of no arguments.

[2013-04-20 Bristol]

Proposed resolution:

This wording is relative to N3376.

  1. Change the class template vector<bool> synopsis, 26.3.12 [vector.bool] p1, as indicated:

    namespace std {
      template <class Allocator> class vector<bool, Allocator> {
        // modifiers:
        template <class... Args> void emplace_back(Args&&... args);
        void push_back(const bool& x);
        void pop_back();
        template <class... Args> iterator emplace(const_iterator position, Args&&... args);
        iterator insert(const_iterator position, const bool& x);