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

#include <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
 
 set ()
 Effects: Default constructs an empty set. More...
 
 set (const Compare &comp, const allocator_type &a=allocator_type())
 Effects: Constructs an empty set using the specified comparison object and allocator. More...
 
 set (const allocator_type &a)
 Effects: Constructs an empty set using the specified allocator object. More...
 
template<class InputIterator >
 set (InputIterator first, InputIterator last, const Compare &comp=Compare(), const allocator_type &a=allocator_type())
 Effects: Constructs an empty set using the specified comparison object and allocator, and inserts elements from the range [first ,last ). More...
 
template<class InputIterator >
 set (ordered_unique_range_t, InputIterator first, InputIterator last, const Compare &comp=Compare(), const allocator_type &a=allocator_type())
 Effects: Constructs an empty set using the specified comparison object and allocator, and inserts elements from the ordered unique range [first ,last). More...
 
 set (std::initializer_list< value_type > il, const Compare &comp=Compare(), const allocator_type &a=allocator_type())
 Effects: Constructs an empty set using the specified comparison object and allocator, and inserts elements from the range [il.begin(), il.end()). More...
 
 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 set using the specified comparison object and allocator, and inserts elements from the ordered unique range [il.begin(), il.end()). More...
 
 set (const set &x)
 Effects: Copy constructs a set. More...
 
 set (BOOST_RV_REF(set) x)
 Effects: Move constructs a set. More...
 
 set (const set &x, const allocator_type &a)
 Effects: Copy constructs a set using the specified allocator. More...
 
 set (BOOST_RV_REF(set) x, const allocator_type &a)
 Effects: Move constructs a set using the specified allocator. More...
 
setoperator= (BOOST_COPY_ASSIGN_REF(set) x)
 Effects: Makes *this a copy of x. More...
 
setoperator= (BOOST_RV_REF(set) x) BOOST_CONTAINER_NOEXCEPT_IF(allocator_traits_type
 Effects: this->swap(x.get()). More...
 
setoperator= (std::initializer_list< value_type > il)
 
template<class InputIterator >
void insert (InputIterator first, InputIterator last)
 Requires: first, last are not iterators into *this. 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...
 
size_type count (const key_type &x) const
 Returns: The number of elements with key equivalent to x. More...
 
size_type count (const key_type &x)
 Returns: The number of elements with key equivalent to x. 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...
 
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...
 

Member Typedef Documentation

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

Constructor & Destructor Documentation

template<class Key , class Compare , class Allocator , class SetOptions >
boost::container::set< Key, Compare, Allocator, SetOptions >::set ( )
inline

Effects: Default constructs an empty set.

Complexity: Constant.

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

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

Complexity: Constant.

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

Effects: Constructs an empty set using the specified allocator object.

Complexity: Constant.

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

Effects: Constructs an empty set 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 , class SetOptions >
template<class InputIterator >
boost::container::set< Key, Compare, Allocator, SetOptions >::set ( ordered_unique_range_t  ,
InputIterator  first,
InputIterator  last,
const Compare &  comp = Compare(),
const allocator_type a = allocator_type() 
)
inline

Effects: Constructs an empty set 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.

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

Effects: Constructs an empty set 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 , class SetOptions >
boost::container::set< Key, Compare, Allocator, SetOptions >::set ( 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 set 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 , class SetOptions >
boost::container::set< Key, Compare, Allocator, SetOptions >::set ( const set< Key, Compare, Allocator, SetOptions > &  x)
inline

Effects: Copy constructs a set.

Complexity: Linear in x.size().

template<class Key , class Compare , class Allocator , class SetOptions >
boost::container::set< Key, Compare, Allocator, SetOptions >::set ( BOOST_RV_REF(set< Key, Compare, Allocator, SetOptions >)  x)
inline

Effects: Move constructs a set.

Constructs *this using x's resources.

Complexity: Constant.

Postcondition: x is emptied.

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

Effects: Copy constructs a set using the specified allocator.

Complexity: Linear in x.size().

template<class Key , class Compare , class Allocator , class SetOptions >
boost::container::set< Key, Compare, Allocator, SetOptions >::set ( BOOST_RV_REF(set< Key, Compare, Allocator, SetOptions >)  x,
const allocator_type a 
)
inline

Effects: Move constructs a set using the specified allocator.

Constructs *this using x's resources.

Complexity: Constant if a == x.get_allocator(), linear otherwise.

Member Function Documentation

template<class Key , class Compare , class Allocator , class SetOptions >
typedef boost::container::set< Key, Compare, Allocator, SetOptions >::BOOST_CONTAINER_IMPDEF ( base_t::stored_allocator_type  )
template<class Key , class Compare , class Allocator , class SetOptions >
typedef boost::container::set< Key, Compare, Allocator, SetOptions >::BOOST_CONTAINER_IMPDEF ( base_t::iterator  )
template<class Key , class Compare , class Allocator , class SetOptions >
typedef boost::container::set< Key, Compare, Allocator, SetOptions >::BOOST_CONTAINER_IMPDEF ( base_t::const_iterator  ) const
template<class Key , class Compare , class Allocator , class SetOptions >
typedef boost::container::set< Key, Compare, Allocator, SetOptions >::BOOST_CONTAINER_IMPDEF ( base_t::reverse_iterator  )
template<class Key , class Compare , class Allocator , class SetOptions >
typedef boost::container::set< Key, Compare, Allocator, SetOptions >::BOOST_CONTAINER_IMPDEF ( base_t::const_reverse_iterator  ) const
template<class Key , class Compare , class Allocator , class SetOptions >
size_type boost::container::set< Key, Compare, Allocator, SetOptions >::count ( const key_type x) const
inline

Returns: The number of elements with key equivalent to x.

Complexity: log(size())+count(k)

References boost::algorithm::find().

template<class Key , class Compare , class Allocator , class SetOptions >
size_type boost::container::set< Key, Compare, Allocator, SetOptions >::count ( const key_type x)
inline

Returns: The number of elements with key equivalent to x.

Complexity: log(size())+count(k)

References boost::asio::end, and boost::algorithm::find().

template<class Key , class Compare , class Allocator , class SetOptions >
std::pair<iterator,iterator> boost::container::set< Key, Compare, Allocator, SetOptions >::equal_range ( const key_type x)
inline

Effects: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).

Complexity: Logarithmic

template<class Key , class Compare , class Allocator , class SetOptions >
std::pair<const_iterator, const_iterator> boost::container::set< Key, Compare, Allocator, SetOptions >::equal_range ( const key_type x) const
inline

Effects: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).

Complexity: Logarithmic

template<class Key , class Compare , class Allocator , class SetOptions >
template<class InputIterator >
void boost::container::set< Key, Compare, Allocator, SetOptions >::insert ( InputIterator  first,
InputIterator  last 
)
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)

Referenced by boost::container::set< Key, Compare, Allocator, SetOptions >::operator=().

template<class Key , class Compare , class Allocator , class SetOptions >
void boost::container::set< Key, Compare, Allocator, SetOptions >::insert ( std::initializer_list< value_type il)
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())

template<class Key , class Compare , class Allocator , class SetOptions >
set& boost::container::set< Key, Compare, Allocator, SetOptions >::operator= ( BOOST_COPY_ASSIGN_REF(set< Key, Compare, Allocator, SetOptions >)  x)
inline

Effects: Makes *this a copy of x.

Complexity: Linear in x.size().

References boost::multiprecision::backends::operator=().

template<class Key , class Compare , class Allocator , class SetOptions >
set& boost::container::set< Key, Compare, Allocator, SetOptions >::operator= ( BOOST_RV_REF(set< Key, Compare, Allocator, SetOptions >)  x)
inline

Effects: this->swap(x.get()).

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.

template<class Key , class Compare , class Allocator , class SetOptions >
set& boost::container::set< Key, Compare, Allocator, SetOptions >::operator= ( std::initializer_list< value_type il)
inline

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