Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Chapter 8. Boost.Container

Ion Gaztanaga

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Table of Contents

Introduction
Building Boost.Container
Tested compilers
Main features
Efficient insertion
Containers of Incomplete Types
SCARY iterators
Other features
Boost.Container and C++ exceptions
Non-standard containers
stable_vector
flat_(multi)map/set associative containers
slist
static_vector
Extended functionality
Default initialization for vector-like containers
C++11 Conformance
Move and Emplace
Stateful allocators
Scoped allocators
Initializer lists
forward_list<T>
vector<bool>
History and reasons to use Boost.Container
Boost.Container history
Why Boost.Container?
Indexes
Class Index
Typedef Index
Function Index
Boost.Container Header Reference
Header <boost/container/allocator_traits.hpp>
Header <boost/container/container_fwd.hpp>
Header <boost/container/deque.hpp>
Header <boost/container/flat_map.hpp>
Header <boost/container/flat_set.hpp>
Header <boost/container/list.hpp>
Header <boost/container/map.hpp>
Header <boost/container/scoped_allocator.hpp>
Header <boost/container/scoped_allocator_fwd.hpp>
Header <boost/container/set.hpp>
Header <boost/container/slist.hpp>
Header <boost/container/stable_vector.hpp>
Header <boost/container/static_vector.hpp>
Header <boost/container/string.hpp>
Header <boost/container/throw_exception.hpp>
Header <boost/container/vector.hpp>
Acknowledgements, notes and links
Release Notes
Boost 1.55 Release
Boost 1.54 Release
Boost 1.53 Release
Boost 1.52 Release
Boost 1.51 Release
Boost 1.50 Release
Boost 1.49 Release
Boost 1.48 Release

Boost.Container library implements several well-known containers, including STL containers. The aim of the library is to offers advanced features not present in standard containers or to offer the latest standard draft features for compilers that comply with C++03.

In short, what does Boost.Container offer?

  • Move semantics are implemented, including move emulation for pre-C++11 compilers.
  • New advanced features (e.g. placement insertion, recursive containers) are present.
  • Containers support stateful allocators and are compatible with Boost.Interprocess (they can be safely placed in shared memory).
  • The library offers new useful containers:
    • flat_map, flat_set, flat_multimap and flat_multiset: drop-in replacements for standard associative containers but more memory friendly and with faster searches.
    • stable_vector: a std::list and std::vector hybrid container: vector-like random-access iterators and list-like iterator stability in insertions and erasures.
    • slist: the classic pre-standard singly linked list implementation offering constant-time size(). Note that C++11 forward_list has no size().

There is no need to compile Boost.Container, since it's a header only library. Just include your Boost header directory in your compiler include path.

Boost.Container requires a decent C++98 compatibility. Some compilers known to work are:

  • Visual C++ >= 7.1.
  • GCC >= 4.1.
  • Intel C++ >= 9.0

Last revised: October 28, 2013 at 23:49:41 GMT


PrevUpHomeNext