Class set<_Key, _Compare, _Alloc>

#include <Geode/c++stl/gnustl/stl_set.h>
template<typename _Key,typename _Compare = std::less<_Key>,typename _Alloc = std::allocator<_Key>>classset{ ... }

A standard container made up of unique keys, which can be retrieved in logarithmic time.

Template parameters

_Key

Type of key objects.

_Compare

Comparison function object type, defaults to less<_Key>.

_Alloc

Allocator type, defaults to allocator<_Key>. Meets the requirements of a <a href="tables.html#65">container</a>, a <a href="tables.html#66">reversible container</a>, and an <a href="tables.html#69">associative container</a> (using unique keys). Sets support bidirectional iterators. The private tree data is declared exactly the same way for set and multiset; the distinction is made entirely in how the tree functions are called (*_unique versus *_equal, same as the standard).
Examples0
Public static methods0
Public member functions43
template<typename _InputIterator>voidset<_Key, _Compare, _Alloc>(,)

Builds a %set from a range.

Parameters

__first

An input iterator.

__last

An input iterator. Create a %set consisting of copies of the elements from [__first,__last). This is linear in N if the range is already sorted, and NlogN otherwise (where N is distance(__first,__last)).
template<typename _InputIterator>voidset<_Key, _Compare, _Alloc>(,,,)

Builds a %set from a range.

Parameters

__first

An input iterator.

__last

An input iterator.

__comp

A comparison functor.

__a

An allocator object. Create a %set consisting of copies of the elements from [__first,__last). This is linear in N if the range is already sorted, and NlogN otherwise (where N is distance(__first,__last)).
template<typename _InputIterator>voidset<_Key, _Compare, _Alloc>(,,)

/// Allocator-extended range constructor.

geode::stl::set&operator=()

%Set assignment operator.

Parameters

__x

A %set of identical element and allocator types. All the elements of
geode::stl::set&operator=()

/// Move assignment operator.

geode::stl::set&operator=()

%Set list assignment operator.

Parameters

__l

An initializer_list. This function fills a %set with copies of the elements in the initializer list
geode::stl::set::key_comparekey_comp()const

/// Returns the comparison object with which the %set was constructed.

geode::stl::set::value_comparevalue_comp()const

/// Returns the comparison object with which the %set was constructed.

geode::stl::set::allocator_typeget_allocator()const

/// Returns the allocator object with which the %set was constructed.

geode::stl::set::iteratorbegin()const

Returns a read-only (constant) iterator that points to the first element in the %set. Iteration is done in ascending order according to the keys.

geode::stl::set::iteratorend()const

Returns a read-only (constant) iterator that points one past the last element in the %set. Iteration is done in ascending order according to the keys.

geode::stl::set::reverse_iteratorrbegin()const

Returns a read-only (constant) iterator that points to the last element in the %set. Iteration is done in descending order according to the keys.

geode::stl::set::reverse_iteratorrend()const

Returns a read-only (constant) reverse iterator that points to the last pair in the %set. Iteration is done in descending order according to the keys.

geode::stl::set::iteratorcbegin()const

Returns a read-only (constant) iterator that points to the first element in the %set. Iteration is done in ascending order according to the keys.

geode::stl::set::iteratorcend()const

Returns a read-only (constant) iterator that points one past the last element in the %set. Iteration is done in ascending order according to the keys.

geode::stl::set::reverse_iteratorcrbegin()const

Returns a read-only (constant) iterator that points to the last element in the %set. Iteration is done in descending order according to the keys.

geode::stl::set::reverse_iteratorcrend()const

Returns a read-only (constant) reverse iterator that points to the last pair in the %set. Iteration is done in descending order according to the keys.

boolempty()const

/// Returns true if the %set is empty.

geode::stl::set::size_typesize()const

/// Returns the size of the %set.

geode::stl::set::size_typemax_size()const

/// Returns the maximum size of the %set.

voidswap()

Swaps data with another %set.

Parameters

__x

A %set of the same element and allocator types. This exchanges the elements between two sets in constant time. (It is only swapping a pointer, an integer, and an instance of the
template<typename... _Args>std::pair<geode::stl::set::iterator,bool>emplace()

Attempts to build and insert an element into the %set.

Parameters

__args

Arguments used to generate an element.
Return value
A pair, of which the first element is an iterator that points to the possibly inserted element, and the second is a bool that is true if the element was actually inserted. This function attempts to build and insert an element into the %set. A %set relies on unique keys and thus an element is only inserted if it is not already present in the %set. Insertion requires logarithmic time.
template<typename... _Args>geode::stl::set::iteratoremplace_hint(,)

Attempts to insert an element into the %set.

Parameters

__pos

An iterator that serves as a hint as to where the element should be inserted.

__args

Arguments used to generate the element to be inserted.
Return value
An iterator that points to the element with key equivalent to the one generated from
std::pair<geode::stl::set::iterator,bool>insert()

Attempts to insert an element into the %set.

Parameters

__x

Element to be inserted.
Return value
A pair, of which the first element is an iterator that points to the possibly inserted element, and the second is a bool that is true if the element was actually inserted. This function attempts to insert an element into the %set. A %set relies on unique keys and thus an element is only inserted if it is not already present in the %set. Insertion requires logarithmic time.
std::pair<geode::stl::set::iterator,bool>insert()
No description provided
geode::stl::set::iteratorinsert(,)

Attempts to insert an element into the %set.

Parameters

__position

An iterator that serves as a hint as to where the element should be inserted.

__x

Element to be inserted.
Return value
An iterator that points to the element with key of
geode::stl::set::iteratorinsert(,)
No description provided
template<typename _InputIterator>voidinsert(,)

A template function that attempts to insert a range of elements.

Parameters

__first

Iterator pointing to the start of the range to be inserted.

__last

Iterator pointing to the end of the range. Complexity similar to that of the range constructor.
voidinsert()

Attempts to insert a list of elements into the %set.

Parameters

__l

A std::initializer_list<value_type> of elements to be inserted. Complexity similar to that of the range constructor.
geode::stl::set::iteratorerase()

Erases an element from a %set.

Parameters

__position

An iterator pointing to the element to be erased.
Return value
An iterator pointing to the element immediately following
geode::stl::set::size_typeerase()

Erases elements according to the provided key.

Parameters

__x

Key of element to be erased.
Return value
The number of elements erased. This function erases all the elements located by the given key from a %set. Note that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.
geode::stl::set::iteratorerase(,)

Erases a [__first,__last) range of elements from a %set.

Parameters

__first

Iterator pointing to the start of the range to be erased.

__last

Iterator pointing to the end of the range to be erased.
Return value
The iterator
voidclear()

Erases all elements in a %set. Note that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way. Managing the pointer is the user’s responsibility.

geode::stl::set::size_typecount()const

Finds the number of elements.

Parameters

__x

Element to located.
Return value
Number of elements with specified key. This function only makes sense for multisets; for set the result will either be 0 (not present) or 1 (present).
geode::stl::set::iteratorfind()

Tries to locate an element in a %set.

Parameters

__x

Element to be located.
Return value
Iterator pointing to sought-after element, or end() if not found. This function takes a key and tries to locate the element with which the key matches. If successful the function returns an iterator pointing to the sought after element. If unsuccessful it returns the past-the-end (
geode::stl::set::const_iteratorfind()const
No description provided
boolcontains()const

Check if the set contains an element.

Parameters

__x

Element to be located.
Return value
True if set contains the element.

ℹ Geode addition.

geode::stl::set::iteratorlower_bound()

Finds the beginning of a subsequence matching given key.

Parameters

__x

Key to be located.
Return value
Iterator pointing to first element equal to or greater than key, or end(). This function returns the first element of a subsequence of elements that matches the given key. If unsuccessful it returns an iterator pointing to the first element that has a greater value than given key or end() if no such element exists.
geode::stl::set::const_iteratorlower_bound()const
No description provided
geode::stl::set::iteratorupper_bound()

Finds the end of a subsequence matching given key.

Parameters

__x

Key to be located.
Return value
Iterator pointing to the first element greater than key, or end().
geode::stl::set::const_iteratorupper_bound()const
No description provided
std::pair<geode::stl::set::iterator,geode::stl::set::iterator>equal_range()

Finds a subsequence matching given key.

Parameters

__x

Key to be located.
Return value
Pair of iterators that possibly points to the subsequence matching given key. This function is equivalent to
std::make_pair(c.lower_bound(val),
               c.upper_bound(val))
std::pair<geode::stl::set::const_iterator,geode::stl::set::const_iterator>equal_range()const
No description provided
Fields0
Protected member functions0
Protected fields0