From d91dc0059b73b15713d04ad842251039473b59cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sat, 10 Aug 2013 22:58:27 +0000 Subject: [PATCH] Fixes #8269 [SVN r85297] --- doc/container.qbk | 3 ++- include/boost/container/flat_map.hpp | 13 ++++++++++++- include/boost/container/flat_set.hpp | 17 +++++++++-------- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/doc/container.qbk b/doc/container.qbk index bc65a48..1c77c07 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -375,7 +375,8 @@ and erasure times considerably. Flat associative containers have the following attributes: * Faster lookup than standard associative containers -* Much faster iteration than standard associative containers +* Much faster iteration than standard associative containers. + Random-access iterators instead of bidirectional iterators. * Less memory consumption for small objects (and for big objects if `shrink_to_fit` is used) * Improved cache performance (data is stored in contiguous memory) * Non-stable iterators (iterators are invalidated when inserting and erasing elements) diff --git a/include/boost/container/flat_map.hpp b/include/boost/container/flat_map.hpp index ac48e6d..da992aa 100644 --- a/include/boost/container/flat_map.hpp +++ b/include/boost/container/flat_map.hpp @@ -84,8 +84,10 @@ static D force_copy(S s) //! This means that inserting a new element into a flat_map invalidates //! previous iterators and references //! -//! Erasing an element of a flat_map invalidates iterators and references +//! Erasing an element invalidates iterators and references //! pointing to elements that come after (their keys are bigger) the erased element. +//! +//! This container provides random-access iterators. #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED template , class Allocator = std::allocator< std::pair< Key, T> > > #else @@ -947,6 +949,15 @@ inline bool operator<(const flat_multimap& x, //! //! Allocator is the allocator to allocate the value_types //! (e.g. allocator< std::pair >). +//! +//! flat_multimap is similar to std::multimap but it's implemented like an ordered vector. +//! This means that inserting a new element into a flat_map invalidates +//! previous iterators and references +//! +//! Erasing an element invalidates iterators and references +//! pointing to elements that come after (their keys are bigger) the erased element. +//! +//! This container provides random-access iterators. #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED template , class Allocator = std::allocator< std::pair< Key, T> > > #else diff --git a/include/boost/container/flat_set.hpp b/include/boost/container/flat_set.hpp index 7acee1c..eed7dda 100644 --- a/include/boost/container/flat_set.hpp +++ b/include/boost/container/flat_set.hpp @@ -51,9 +51,7 @@ inline bool operator<(const flat_set& x, /// @endcond //! flat_set is a Sorted Associative Container that stores objects of type Key. -//! flat_set is a Simple Associative Container, meaning that its value type, -//! as well as its key type, is Key. It is also a Unique Associative Container, -//! meaning that no two elements are the same. +//! It is also a Unique Associative Container, meaning that no two elements are the same. //! //! flat_set is similar to std::set but it's implemented like an ordered vector. //! This means that inserting a new element into a flat_set invalidates @@ -61,6 +59,8 @@ inline bool operator<(const flat_set& x, //! //! Erasing an element of a flat_set invalidates iterators and references //! pointing to elements that come after (their keys are bigger) the erased element. +//! +//! This container provides random-access iterators. #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED template , class Allocator = std::allocator > #else @@ -763,16 +763,17 @@ inline bool operator<(const flat_multiset& x, /// @endcond //! flat_multiset is a Sorted Associative Container that stores objects of type Key. -//! flat_multiset is a Simple Associative Container, meaning that its value type, -//! as well as its key type, is Key. -//! flat_Multiset can store multiple copies of the same key value. +//! +//! flat_multiset can store multiple copies of the same key value. //! //! flat_multiset is similar to std::multiset but it's implemented like an ordered vector. //! This means that inserting a new element into a flat_multiset invalidates //! previous iterators and references //! -//! Erasing an element of a flat_multiset invalidates iterators and references -//! pointing to elements that come after (their keys are equal or bigger) the erased element. +//! Erasing an element invalidates iterators and references +//! pointing to elements that come after (their keys are bigger) the erased element. +//! +//! This container provides random-access iterators. #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED template , class Allocator = std::allocator > #else