![]() |
Home | Libraries | People | FAQ | More |
Boost.Container is a product of a long development
effort that started in
2004 with the experimental Shmem library, which pioneered the use
of standard containers in shared memory. Shmem included modified SGI STL
container code tweaked to support non-raw allocator::pointer
types and stateful allocators. Once reviewed, Shmem was accepted as Boost.Interprocess
and this library continued to refine and improve those containers.
In 2007, container code from node containers (map,
list, slist)
was rewritten, refactored and expanded to build the intrusive container library
Boost.Intrusive.
Boost.Interprocess containers were refactored
to take advantage of Boost.Intrusive containers
and code duplication was minimized. Both libraries continued to gain support
and bug fixes for years. They introduced move semantics, emplacement insertion
and more features of then unreleased C++0x standard.
Boost.Interprocess containers were always
standard compliant, and those containers and new containers like stable_vector and flat_[multi]set/map were used outside Boost.Interprocess
with success. As containers were mature enough to get their own library,
it was a natural step to collect them containers and build Boost.Container,
a library targeted to a wider audience.
flat_[multi]_map/set containers were originally based
on Loki's
AssocVector class. Code was rewritten and expanded for Boost.Interprocess,
so thanks to Andrei Alexandrescu.
stable_vector was invented
and coded by Joaquín
M. López Muñoz, then adapted for Boost.Interprocess.
Thanks for such a great container.
static_vector was based
on Andrew Hundt's and Adam Wulkiewicz's high-performance varray class. Many performance improvements
of vector were also inspired
by their implementation. Thanks!
devector's initial implementation
is based on Thaler Benedek's high-performance devector
implementation, then adapted for Boost.Container.
Also inspired by similar implemenations by Orson Peters and Lars Hagen.
Thanks for such a great code and documentation!
static_vector<T>'s destructor is now trivial if
T is trivial.
uninitialized_construct_using_allocator
and make_obj_using_allocator.
[[nodiscard]] to several allocator and PMR utilities.
new_allocator
and pmr::new_delete_resource():
__cpp_aligned_new feature.
posix_memalign, aligned_alloc, _aligned_malloc...) otherwise.
adaptive_pooland
node_allocator
erase/erase_if/unique
members of list and
slist to size_type to follow C++20 changes
to std::list.
basic_string:
string_view
members and updated operator[] to be able to return the terminating
null.
starts_with/ends_with and C++23 contains overloads.
basic_string
methods taking const CharT*
parameters.
std::nullptr_t.
inline_chars,
growth_factor
and stored_size
options to basic_string.
segtor
container: the single ended brother of deque:
a random-access sequence container with segmented (block-based)
storage like deque but only growth at the back.
boost::container::deque.
The original implementation was based on the SGI's original data structure
(similar to libstdc++). Main changes:
sizeof(deque)
was 10 words, now is 4 words. Probably the lightest implementation
around.
sizeof(deque::iterator)
was 4 words, now is is 2 words (similar to libc++ and MSVC).
stored_size
option to static_vector
and small_vector.
devector's
insertion logic has been reimplemented to move elements to the center
of the devector if an insertion at one end has no free capacity but
there is free capacity on the other end. Current implementation keeps
reallocating memory when only inserting at one end and poping from
the other, provoking very high memory usage. The new strategy is based
on the article Double-ended
vector - is it useful? by Lars Greger Nordland Hagen.
boost/container/vector.hpp preprocessed file size reduces
from 1,5MB to 930KB. If you still want to use standard exception classes,
you can define BOOST_CONTAINER_USE_STD_EXCEPTIONS
before using any Boost.Container class.
pmr::map with a std::pair;
works when using a std::tuple".
devector
container.
equal_range can result in a
range with length greater than 1".
deque can now
have options, using deque_options.
The block size/bytes can be be specified.
static_vector
can now have options, using static_vector_options.
Alignment and throwing behaviour can be be specified.
small_vector
can now have options, using small_vector_options.
Alignment and growth factor can be be specified.
new_allocator<T> to void
to reduce symbol lenghts.
contains() for associative containers as specified
in P0458R2:
Checking for Existence of an Element in Associative Containers.
adaptive_pool
and many parameters are now compile-time constants instead of runtime
constants.
[multi]map/[multi]set/flat_[multi]map/flat_[multi]set.
unsynchronized_pool_resource
found by Arthur O'Dowyer in his blog post <memory_resource>
for libc++
release()
the original buffer is recovered for the next allocation.
vector_options.
The growth factor and the stored size type can be specified.
extract_sequence,
adopt_sequence functions
for flat_[multi]map/set associative containers.
static_vector<>::static_capacity
to use the configured capacity in constant expressions.
insert_or_assign/try_emplace for map
and flat_map.
map,
multimap,
set, multiset.
deque,
vector, stable_vector, small_vector,
static_vector, list and slist.
boost::container::small_vector
supports more constructors and assignments.
pop_back, pop_front, back,
front, etc.)
back/front operations to basic_string.
small_vector
container.
nth and index_of functions to containers
with random-access iterators (except basic_string).
allocator_traits<Allocator>::is_always_equal.
scoped_allocator_adaptor's
propagate_on_container_copy_assignment,
propagate_on_container_move_assignment
and propagate_on_container_swap
are no longer ::boost::integral_constant<bool, true/false> types. The dependency reorganization
needed to break with those classes to avoid MPL dependencies, and interoperability
with std::integral_constant was not guaranteed.
Code assumming boost::true_type/boost::false_type
on this will not compile. As a workaround, use the guaranteed internal
::value
constant: ::boost::integral_constant<bool, scoped_allocator_adaptor<Allocator>::propagate_on_container_move_assignment::value>.
initializer_list.
Contributed by Robert Matusewicz.
set, multiset,
map and multimap.
static_vector
class, based on Andrew Hundt's and Adam Wulkiewicz's high performance
varray class.
vector
constructors/copy/move/swap, dispatching to memcpy when possible.
BOOST_NO_EXCEPTIONS
#7227.
vector's insertion
performance.
stable_vector's
template code bloat and type safety.