|
| rw_orderedhashset (const rw_orderedhashset &other) |
|
template<typename InputIterator > |
| rw_orderedhashset (InputIterator first, InputIterator last, size_type cap=64, const hasher &h=hasher(), const key_equal_type &eq=key_equal_type()) |
|
| rw_orderedhashset (rw_orderedhashset &&other) |
|
| rw_orderedhashset (size_type cap=64, const hasher &h=hasher(), const key_equal_type &eq=key_equal_type()) |
|
| ~rw_orderedhashset (void) |
|
iterator | begin (void) |
|
const_iterator | begin (void) const |
|
size_type | capacity (void) const |
|
const_iterator | cbegin (void) const |
|
const_iterator | cend (void) const |
|
void | clear (void) |
|
size_type | count (const value_type &key) const |
|
bool | empty (void) const |
|
iterator | end (void) |
|
const_iterator | end (void) const |
|
std::pair< iterator, iterator > | equal_range (const value_type &key) const |
|
size_type | erase (const value_type &key) |
|
iterator | erase (iterator first, iterator last) |
|
iterator | erase (iterator iter) |
|
float | fill_ratio (void) const |
|
iterator | find (const value_type &key) const |
|
std::pair< iterator, bool > | insert (const value_type &val) |
|
template<typename InputIterator > |
size_type | insert (InputIterator first, InputIterator last) |
|
iterator | insert (iterator hint, const value_type &val) |
|
iterator | insert (iterator hint, value_type &&val) |
|
std::pair< iterator, bool > | insert (value_type &&val) |
|
iterator | lower_bound (const value_type &key) const |
|
rw_orderedhashset & | operator= (const rw_orderedhashset &rhs) |
|
rw_orderedhashset & | operator= (rw_orderedhashset &&rhs) |
|
void | resize (size_type cap) |
|
size_type | size (void) const |
|
void | swap (rw_orderedhashset &other) |
|
iterator | upper_bound (const value_type &key) const |
|
|
(Note that these are not member symbols.)
|
template<class T , class Hash , class EQ , class A > |
bool | operator!= (const rw_orderedhashset< T, Hash, EQ, A > &lhs, const rw_orderedhashset< T, Hash, EQ, A > &rhs) |
|
template<class T , class Hash , class EQ , class A > |
bool | operator== (const rw_orderedhashset< T, Hash, EQ, A > &lhs, const rw_orderedhashset< T, Hash, EQ, A > &rhs) |
|
template<class T, class Hash = RWTHash<T>, class EQ = std::equal_to<T>, class A = std::allocator<T>>
class rw_orderedhashset< T, Hash, EQ, A >
Class rw_orderedhashset maintains a collection of T
, implemented as a hash table in which there may not be more than one instance of any given T
. Since this is a value-based collection, objects are copied into and out of the collection. As with all classes that meet the ANSI associative container specification, rw_orderedhashset provides for iterators that reference its elements. rw_orderedhashset preserves key insertion order.
Hash
must provide a const
function that takes a single argument convertible to type T
and returns a value of type size_t
.
- Note
- Any two elements that are equivalent must hash to the same value.
Element equality is determined by an equality function of type EQ
, which takes two arguments convertible to type T
and returns a value of type bool
.
- Note
- Any two elements that are equivalent are disallowed for this container.
- Synopsis
#include <rw/stdex/orderedhashset.h>
Maintains a collection of some type T, in which there cannot be more than one occurrence of some give...
Definition orderedhashset.h:58
- Persistence
- None
template<class T , class Hash , class EQ , class A >
template<typename InputIterator >
Constructs an rw_orderedhashset containing a copy of the elements in the range [first, last). The rw_orderedhashset instance has cap buckets, uses h as its hash function object, and eq as the equality function object.
InputIterator
is an input iterator type that points to elements that are convertible to value_type objects.
- Note
- If the value specified for cap is zero, the default number of buckets is used.
template<class T , class Hash , class EQ , class A >
Inserts a copy of val into the container. If an element in the container is equivalent to val, an iterator to the existing element in the collection is returned with an associated status of false
. Otherwise, the value val is inserted into the collection and an iterator to the new item is returned, along with the status true
.
template<class T , class Hash , class EQ , class A >
template<typename InputIterator >
For each value in the range [first, last), inserts a copy of the value into self. If an element in the container is equivalent to the value, the value is not inserted. Returns the number of elements inserted.
InputIterator
is an input iterator type that points to elements that are convertible to value_type objects.
- Note
- first and last must not be iterators into self.
template<class T , class Hash , class EQ , class A >
Inserts a copy of val into the container. If an element in the container is equivalent to val, an iterator to the existing element in the collection is returned with an associated status of false
. Otherwise, the value val is inserted into the collection and an iterator to the new item is returned, along with the status true
.
The parameter hint is ignored.
template<class T , class Hash , class EQ , class A >
Inserts val into the container. If an element in the container is equivalent to val, an iterator to the existing element in the collection is returned with an associated status of false
. Otherwise, the value val is inserted into the collection and an iterator to the new item is returned, along with the status true
.
The parameter hint is ignored.
- Condition:
- This method is available only on platforms with rvalue reference support.
template<class T , class Hash , class EQ , class A >
Inserts val into the container. If an element in the container is equivalent to val, an iterator to the existing element in the collection is returned with an associated status of false
. Otherwise, the value val is inserted into the collection and an iterator to the new item is returned, along with the status true
.
- Condition:
- This method is available only on platforms with rvalue reference support.