Use std::deque
if you don’t need the array, yes.
Otherwise use an alternative vector
that doesn’t specialize on bool
, such as the one in Boost Container.
More Related Contents:
- Is the use of std::vector objects in C++ acceptable, or should I use an alternative?
- Thou shalt not inherit from std::vector
- What’s the most efficient way to erase duplicates and sort a vector?
- std::vector::resize() vs. std::vector::reserve()
- Is std::vector so much slower than plain arrays?
- vector vs. list in STL
- How do I sort a std::vector by the values of a different std::vector?
- How do I erase an element from std::vector by index?
- Best way to extract a subvector from a vector?
- How to avoid memory leaks when using a vector of pointers to dynamically allocated objects in C++?
- How to get std::vector pointer to the raw data?
- C++ Erase vector element by value rather than by position? [duplicate]
- Looking for C++ STL-like vector class but using stack storage
- Appending a vector to a vector [duplicate]
- Does vector::erase() on a vector of object pointers destroy the object itself?
- Sorting a vector in descending order
- How do I print the elements of a C++ vector in GDB?
- Why is it OK to return a ‘vector’ from a function?
- What’s faster, iterating an STL vector with vector::iterator or with at()?
- Sorting a std::vector by the string?
- array vs vector vs list
- Cleaning up an STL list/vector of pointers
- std::vector reserve() and push_back() is faster than resize() and array index, why?
- Vector Iterators Incompatible
- Why the libc++ std::vector internally keeps three pointers instead of one pointer and two sizes?
- std::vector capacity after copying
- iterator for 2d vector
- C++ template function compiles in header but not implementation
- vector and const
- How to get the address of the std::vector buffer start most elegantly?