Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::container::flat_multiset< Key, Compare, Allocator > Class Template Reference

flat_multiset is a Sorted Associative Container that stores objects of type Key. More...

#include <flat_set.hpp>

Public Types

typedef Key key_type
 
typedef Key value_type
 
typedef Compare key_compare
 
typedef Compare value_compare
 
typedef
::boost::container::allocator_traits
< Allocator > 
allocator_traits_type
 
typedef
::boost::container::allocator_traits
< Allocator >::pointer 
pointer
 
typedef
::boost::container::allocator_traits
< Allocator >::const_pointer 
const_pointer
 
typedef
::boost::container::allocator_traits
< Allocator >::reference 
reference
 
typedef
::boost::container::allocator_traits
< Allocator >::const_reference 
const_reference
 
typedef
::boost::container::allocator_traits
< Allocator >::size_type 
size_type
 
typedef
::boost::container::allocator_traits
< Allocator >::difference_type 
difference_type
 
typedef Allocator allocator_type
 

Public Member Functions

typedef BOOST_CONTAINER_IMPDEF (base_t::stored_allocator_type) stored_allocator_type
 
typedef BOOST_CONTAINER_IMPDEF (base_t::iterator) iterator
 
typedef BOOST_CONTAINER_IMPDEF (base_t::const_iterator) const _iterator
 
typedef BOOST_CONTAINER_IMPDEF (base_t::reverse_iterator) reverse_iterator
 
typedef BOOST_CONTAINER_IMPDEF (base_t::const_reverse_iterator) const _reverse_iterator
 
 flat_multiset ()
 Effects: Default constructs an empty container. More...
 
 flat_multiset (const Compare &comp, const allocator_type &a=allocator_type())
 Effects: Constructs an empty container using the specified comparison object and allocator. More...
 
 flat_multiset (const allocator_type &a)
 Effects: Constructs an empty container using the specified allocator. More...
 
template<class InputIterator >
 flat_multiset (InputIterator first, InputIterator last, const Compare &comp=Compare(), const allocator_type &a=allocator_type())
 Effects: Constructs an empty container using the specified comparison object and allocator, and inserts elements from the range [first ,last ). More...
 
template<class InputIterator >
 flat_multiset (ordered_range_t, InputIterator first, InputIterator last, const Compare &comp=Compare(), const allocator_type &a=allocator_type())
 Effects: Constructs an empty flat_multiset using the specified comparison object and allocator, and inserts elements from the ordered range [first ,last ). More...
 
 flat_multiset (std::initializer_list< value_type > il, const Compare &comp=Compare(), const allocator_type &a=allocator_type())
 Effects: Constructs an empty container using the specified comparison object and allocator, and inserts elements from the range [il.begin(), il.end()). More...
 
 flat_multiset (ordered_unique_range_t, std::initializer_list< value_type > il, const Compare &comp=Compare(), const allocator_type &a=allocator_type())
 Effects: Constructs an empty container using the specified comparison object and allocator, and inserts elements from the ordered unique range [il.begin(), il.end()). More...
 
 flat_multiset (const flat_multiset &x)
 Effects: Copy constructs the container. More...
 
 flat_multiset (BOOST_RV_REF(flat_multiset) mx)
 
 flat_multiset (const flat_multiset &x, const allocator_type &a)
 
 flat_multiset (BOOST_RV_REF(flat_multiset) mx, const allocator_type &a)
 
flat_multisetoperator= (BOOST_COPY_ASSIGN_REF(flat_multiset) x)
 
flat_multisetoperator= (BOOST_RV_REF(flat_multiset) mx) BOOST_CONTAINER_NOEXCEPT_IF(allocator_traits_type
 
flat_multisetoperator= (std::initializer_list< value_type > il)
 Effects: Copy all elements from il to *this. More...
 
template<class InputIterator >
void insert (InputIterator first, InputIterator last)
 Requires: first, last are not iterators into *this. More...
 
template<class InputIterator >
void insert (ordered_range_t, InputIterator first, InputIterator last)
 Requires: first, last are not iterators into *this and must be ordered according to the predicate. More...
 
void insert (std::initializer_list< value_type > il)
 Effects: inserts each element from the range [il.begin(), il.end()). More...
 
void insert (ordered_range_t, std::initializer_list< value_type > il)
 Requires: Range [il.begin(), il.end()) must be ordered according to the predicate. More...
 

Detailed Description

template<class Key, class Compare, class Allocator>
class boost::container::flat_multiset< Key, Compare, Allocator >

flat_multiset is a Sorted Associative Container that stores objects of type Key.

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 invalidates iterators and references pointing to elements that come after (their keys are bigger) the erased element.

This container provides random-access iterators.

Template Parameters
Keyis the type to be inserted in the multiset, which is also the key_type
Compareis the comparison functor used to order keys
Allocatoris the allocator to be used to allocate memory for this container

Member Typedef Documentation

template<class Key , class Compare , class Allocator >
typedef ::boost::container::allocator_traits<Allocator> boost::container::flat_multiset< Key, Compare, Allocator >::allocator_traits_type
template<class Key , class Compare , class Allocator >
typedef Allocator boost::container::flat_multiset< Key, Compare, Allocator >::allocator_type
template<class Key , class Compare , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::const_pointer boost::container::flat_multiset< Key, Compare, Allocator >::const_pointer
template<class Key , class Compare , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::const_reference boost::container::flat_multiset< Key, Compare, Allocator >::const_reference
template<class Key , class Compare , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::difference_type boost::container::flat_multiset< Key, Compare, Allocator >::difference_type
template<class Key , class Compare , class Allocator >
typedef Compare boost::container::flat_multiset< Key, Compare, Allocator >::key_compare
template<class Key , class Compare , class Allocator >
typedef Key boost::container::flat_multiset< Key, Compare, Allocator >::key_type
template<class Key , class Compare , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::pointer boost::container::flat_multiset< Key, Compare, Allocator >::pointer
template<class Key , class Compare , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::reference boost::container::flat_multiset< Key, Compare, Allocator >::reference
template<class Key , class Compare , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::size_type boost::container::flat_multiset< Key, Compare, Allocator >::size_type
template<class Key , class Compare , class Allocator >
typedef Compare boost::container::flat_multiset< Key, Compare, Allocator >::value_compare
template<class Key , class Compare , class Allocator >
typedef Key boost::container::flat_multiset< Key, Compare, Allocator >::value_type

Constructor & Destructor Documentation

template<class Key , class Compare , class Allocator >
boost::container::flat_multiset< Key, Compare, Allocator >::flat_multiset ( )
inlineexplicit

Effects: Default constructs an empty container.

Complexity: Constant.

template<class Key , class Compare , class Allocator >
boost::container::flat_multiset< Key, Compare, Allocator >::flat_multiset ( const Compare &  comp,
const allocator_type a = allocator_type() 
)
inlineexplicit

Effects: Constructs an empty container using the specified comparison object and allocator.

Complexity: Constant.

template<class Key , class Compare , class Allocator >
boost::container::flat_multiset< Key, Compare, Allocator >::flat_multiset ( const allocator_type a)
inlineexplicit

Effects: Constructs an empty container using the specified allocator.

Complexity: Constant.

template<class Key , class Compare , class Allocator >
template<class InputIterator >
boost::container::flat_multiset< Key, Compare, Allocator >::flat_multiset ( InputIterator  first,
InputIterator  last,
const Compare &  comp = Compare(),
const allocator_type a = allocator_type() 
)
inline

Effects: Constructs an empty container using the specified comparison object and allocator, and inserts elements from the range [first ,last ).

Complexity: Linear in N if the range [first ,last ) is already sorted using comp and otherwise N logN, where N is last - first.

template<class Key , class Compare , class Allocator >
template<class InputIterator >
boost::container::flat_multiset< Key, Compare, Allocator >::flat_multiset ( ordered_range_t  ,
InputIterator  first,
InputIterator  last,
const Compare &  comp = Compare(),
const allocator_type a = allocator_type() 
)
inline

Effects: Constructs an empty flat_multiset using the specified comparison object and allocator, and inserts elements from the ordered range [first ,last ).

This function is more efficient than the normal range creation for ordered ranges.

Requires: [first ,last) must be ordered according to the predicate.

Complexity: Linear in N.

Note: Non-standard extension.

template<class Key , class Compare , class Allocator >
boost::container::flat_multiset< Key, Compare, Allocator >::flat_multiset ( std::initializer_list< value_type il,
const Compare &  comp = Compare(),
const allocator_type a = allocator_type() 
)
inline

Effects: Constructs an empty container using the specified comparison object and allocator, and inserts elements from the range [il.begin(), il.end()).

Complexity: Linear in N if the range [il.begin(), il.end()) is already sorted using comp and otherwise N logN, where N is il.begin() - il.end().

template<class Key , class Compare , class Allocator >
boost::container::flat_multiset< Key, Compare, Allocator >::flat_multiset ( ordered_unique_range_t  ,
std::initializer_list< value_type il,
const Compare &  comp = Compare(),
const allocator_type a = allocator_type() 
)
inline

Effects: Constructs an empty container using the specified comparison object and allocator, and inserts elements from the ordered unique range [il.begin(), il.end()).

This function is more efficient than the normal range creation for ordered ranges.

Requires: [il.begin(), il.end()) must be ordered according to the predicate and must be unique values.

Complexity: Linear in N.

Note: Non-standard extension.

template<class Key , class Compare , class Allocator >
boost::container::flat_multiset< Key, Compare, Allocator >::flat_multiset ( const flat_multiset< Key, Compare, Allocator > &  x)
inline

Effects: Copy constructs the container.

Complexity: Linear in x.size().

template<class Key , class Compare , class Allocator >
boost::container::flat_multiset< Key, Compare, Allocator >::flat_multiset ( BOOST_RV_REF(flat_multiset< Key, Compare, Allocator >)  mx)
inline

template<class Key , class Compare , class Allocator >
boost::container::flat_multiset< Key, Compare, Allocator >::flat_multiset ( const flat_multiset< Key, Compare, Allocator > &  x,
const allocator_type a 
)
inline

template<class Key , class Compare , class Allocator >
boost::container::flat_multiset< Key, Compare, Allocator >::flat_multiset ( BOOST_RV_REF(flat_multiset< Key, Compare, Allocator >)  mx,
const allocator_type a 
)
inline

Member Function Documentation

template<class Key , class Compare , class Allocator >
typedef boost::container::flat_multiset< Key, Compare, Allocator >::BOOST_CONTAINER_IMPDEF ( base_t::stored_allocator_type  )
template<class Key , class Compare , class Allocator >
typedef boost::container::flat_multiset< Key, Compare, Allocator >::BOOST_CONTAINER_IMPDEF ( base_t::iterator  )
template<class Key , class Compare , class Allocator >
typedef boost::container::flat_multiset< Key, Compare, Allocator >::BOOST_CONTAINER_IMPDEF ( base_t::const_iterator  ) const
template<class Key , class Compare , class Allocator >
typedef boost::container::flat_multiset< Key, Compare, Allocator >::BOOST_CONTAINER_IMPDEF ( base_t::reverse_iterator  )
template<class Key , class Compare , class Allocator >
typedef boost::container::flat_multiset< Key, Compare, Allocator >::BOOST_CONTAINER_IMPDEF ( base_t::const_reverse_iterator  ) const
template<class Key , class Compare , class Allocator >
template<class InputIterator >
void boost::container::flat_multiset< Key, Compare, Allocator >::insert ( InputIterator  first,
InputIterator  last 
)
inline

Requires: first, last are not iterators into *this.

Effects: inserts each element from the range [first,last) .

Complexity: At most N log(size()+N) (N is the distance from first to last) search time plus N*size() insertion time.

Note: If an element is inserted it might invalidate elements.

template<class Key , class Compare , class Allocator >
template<class InputIterator >
void boost::container::flat_multiset< Key, Compare, Allocator >::insert ( ordered_range_t  ,
InputIterator  first,
InputIterator  last 
)
inline

Requires: first, last are not iterators into *this and must be ordered according to the predicate.

Effects: inserts each element from the range [first,last) .This function is more efficient than the normal range creation for ordered ranges.

Complexity: At most N log(size()+N) (N is the distance from first to last) search time plus N*size() insertion time.

Note: Non-standard extension. If an element is inserted it might invalidate elements.

template<class Key , class Compare , class Allocator >
void boost::container::flat_multiset< Key, Compare, Allocator >::insert ( std::initializer_list< value_type il)
inline

Effects: inserts each element from the range [il.begin(), il.end()).

Complexity: At most N log(size()+N) (N is the distance from first to last) search time plus N*size() insertion time.

Note: If an element is inserted it might invalidate elements.

template<class Key , class Compare , class Allocator >
void boost::container::flat_multiset< Key, Compare, Allocator >::insert ( ordered_range_t  ,
std::initializer_list< value_type il 
)
inline

Requires: Range [il.begin(), il.end()) must be ordered according to the predicate.

Effects: inserts each element from the range [il.begin(), il.end()). This function is more efficient than the normal range creation for ordered ranges.

Complexity: At most N log(size()+N) (N is the distance from il.begin() to il.end()) search time plus N*size() insertion time.

Note: Non-standard extension. If an element is inserted it might invalidate elements.

template<class Key , class Compare , class Allocator >
flat_multiset& boost::container::flat_multiset< Key, Compare, Allocator >::operator= ( BOOST_COPY_ASSIGN_REF(flat_multiset< Key, Compare, Allocator >)  x)
inline
template<class Key , class Compare , class Allocator >
flat_multiset& boost::container::flat_multiset< Key, Compare, Allocator >::operator= ( BOOST_RV_REF(flat_multiset< Key, Compare, Allocator >)  mx)
inline
template<class Key , class Compare , class Allocator >
flat_multiset& boost::container::flat_multiset< Key, Compare, Allocator >::operator= ( std::initializer_list< value_type il)
inline

Effects: Copy all elements from il to *this.

Complexity: Linear in il.size().


The documentation for this class was generated from the following files: