flat_set 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_set () | |
Effects: Default constructs an empty container. More... | |
flat_set (const Compare &comp, const allocator_type &a=allocator_type()) | |
Effects: Constructs an empty container using the specified comparison object and allocator. More... | |
flat_set (const allocator_type &a) | |
Effects: Constructs an empty container using the specified allocator. More... | |
template<class InputIterator > | |
flat_set (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_set (ordered_unique_range_t, 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 ordered unique range [first ,last). More... | |
flat_set (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_set (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_set (const flat_set &x) | |
Effects: Copy constructs the container. More... | |
flat_set (BOOST_RV_REF(flat_set) mx) | |
Effects: Move constructs thecontainer. More... | |
flat_set (const flat_set &x, const allocator_type &a) | |
Effects: Copy constructs a container using the specified allocator. More... | |
flat_set (BOOST_RV_REF(flat_set) mx, const allocator_type &a) | |
Effects: Move constructs a container using the specified allocator. More... | |
flat_set & | operator= (BOOST_COPY_ASSIGN_REF(flat_set) x) |
Effects: Makes *this a copy of x. More... | |
flat_set & | operator= (BOOST_RV_REF(flat_set) x) BOOST_CONTAINER_NOEXCEPT_IF(allocator_traits_type |
Throws: If allocator_traits_type::propagate_on_container_move_assignment is false and (allocation throws or value_type's move constructor throws) More... | |
flat_set & | operator= (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_unique_range_t, InputIterator first, InputIterator last) |
Requires: first, last are not iterators into *this and must be ordered according to the predicate and must be unique values. More... | |
void | insert (std::initializer_list< value_type > il) |
Effects: inserts each element from the range [il.begin(), il.end()) if and only if there is no element with key equivalent to the key of that element. More... | |
void | insert (ordered_unique_range_t, std::initializer_list< value_type > il) |
Requires: Range [il.begin(), il.end()) must be ordered according to the predicate and must be unique values. More... | |
size_type | count (const key_type &x) const |
Returns: The number of elements with key equivalent to x. More... | |
std::pair< const_iterator, const_iterator > | equal_range (const key_type &x) const |
Effects: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)). More... | |
std::pair< iterator, iterator > | equal_range (const key_type &x) |
Effects: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)). More... | |
flat_set is a Sorted Associative Container that stores objects of type Key.
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 previous iterators and references
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.
Key | is the type to be inserted in the set, which is also the key_type |
Compare | is the comparison functor used to order keys |
Allocator | is the allocator to be used to allocate memory for this container |
typedef ::boost::container::allocator_traits<Allocator> boost::container::flat_set< Key, Compare, Allocator >::allocator_traits_type |
typedef Allocator boost::container::flat_set< Key, Compare, Allocator >::allocator_type |
typedef ::boost::container::allocator_traits<Allocator>::const_pointer boost::container::flat_set< Key, Compare, Allocator >::const_pointer |
typedef ::boost::container::allocator_traits<Allocator>::const_reference boost::container::flat_set< Key, Compare, Allocator >::const_reference |
typedef ::boost::container::allocator_traits<Allocator>::difference_type boost::container::flat_set< Key, Compare, Allocator >::difference_type |
typedef Compare boost::container::flat_set< Key, Compare, Allocator >::key_compare |
typedef Key boost::container::flat_set< Key, Compare, Allocator >::key_type |
typedef ::boost::container::allocator_traits<Allocator>::pointer boost::container::flat_set< Key, Compare, Allocator >::pointer |
typedef ::boost::container::allocator_traits<Allocator>::reference boost::container::flat_set< Key, Compare, Allocator >::reference |
typedef ::boost::container::allocator_traits<Allocator>::size_type boost::container::flat_set< Key, Compare, Allocator >::size_type |
typedef Compare boost::container::flat_set< Key, Compare, Allocator >::value_compare |
typedef Key boost::container::flat_set< Key, Compare, Allocator >::value_type |
|
inlineexplicit |
Effects: Default constructs an empty container.
Complexity: Constant.
|
inlineexplicit |
Effects: Constructs an empty container using the specified comparison object and allocator.
Complexity: Constant.
|
inlineexplicit |
Effects: Constructs an empty container using the specified allocator.
Complexity: Constant.
|
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.
|
inline |
Effects: Constructs an empty container using the specified comparison object and allocator, and inserts elements from the ordered unique 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 and must be unique values.
Complexity: Linear in N.
Note: Non-standard extension.
|
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().
|
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.
|
inline |
Effects: Copy constructs the container.
Complexity: Linear in x.size().
|
inline |
Effects: Move constructs thecontainer.
Constructs *this using mx's resources.
Complexity: Constant.
Postcondition: mx is emptied.
|
inline |
Effects: Copy constructs a container using the specified allocator.
Complexity: Linear in x.size().
|
inline |
Effects: Move constructs a container using the specified allocator.
Constructs *this using mx's resources.
Complexity: Constant if a == mx.get_allocator(), linear otherwise
typedef boost::container::flat_set< Key, Compare, Allocator >::BOOST_CONTAINER_IMPDEF | ( | base_t::stored_allocator_type | ) |
typedef boost::container::flat_set< Key, Compare, Allocator >::BOOST_CONTAINER_IMPDEF | ( | base_t::iterator | ) |
typedef boost::container::flat_set< Key, Compare, Allocator >::BOOST_CONTAINER_IMPDEF | ( | base_t::const_iterator | ) | const |
typedef boost::container::flat_set< Key, Compare, Allocator >::BOOST_CONTAINER_IMPDEF | ( | base_t::reverse_iterator | ) |
typedef boost::container::flat_set< Key, Compare, Allocator >::BOOST_CONTAINER_IMPDEF | ( | base_t::const_reverse_iterator | ) | const |
|
inline |
Returns: The number of elements with key equivalent to x.
Complexity: log(size())+count(k)
References boost::algorithm::find().
|
inline |
Effects: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
Complexity: Logarithmic
|
inline |
Effects: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
Complexity: Logarithmic
|
inline |
Requires: first, last are not iterators into *this.
Effects: inserts each element from the range [first,last) if and only if there is no element with key equivalent to the key of that element.
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.
|
inline |
Requires: first, last are not iterators into *this and must be ordered according to the predicate and must be unique values.
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.
|
inline |
Effects: inserts each element from the range [il.begin(), il.end()) if and only if there is no element with key equivalent to the key of that element.
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: If an element is inserted it might invalidate elements.
|
inline |
Requires: Range [il.begin(), il.end()) must be ordered according to the predicate and must be unique values.
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.
|
inline |
Effects: Makes *this a copy of x.
Complexity: Linear in x.size().
References boost::multiprecision::backends::operator=().
|
inline |
Throws: If allocator_traits_type::propagate_on_container_move_assignment is false and (allocation throws or value_type's move constructor throws)
Complexity: Constant if allocator_traits_type:: propagate_on_container_move_assignment is true or this->get>allocator() == x.get_allocator(). Linear otherwise.
References boost::move(), boost::multiprecision::backends::operator=(), and boost::flyweights::x.
|
inline |
Effects: Copy all elements from il to *this.
Complexity: Linear in il.size().