|
| rw_orderedhashset (size_type cap=64, const hasher &h=hasher(), const key_equal_type &eq=key_equal_type()) |
|
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 (const rw_orderedhashset &other) |
|
| rw_orderedhashset (rw_orderedhashset &&other) |
|
| ~rw_orderedhashset () |
|
iterator | begin () |
|
const_iterator | begin () const |
|
size_type | capacity () const |
|
const_iterator | cbegin () const |
|
const_iterator | cend () const |
|
void | clear () |
|
size_type | count (const_reference key) const |
|
bool | empty () const |
|
iterator | end () |
|
const_iterator | end () const |
|
std::pair< iterator, iterator > | equal_range (const_reference key) const |
|
size_type | erase (const_reference key) |
|
iterator | erase (iterator iter) |
|
iterator | erase (iterator first, iterator last) |
|
float | fill_ratio () const |
|
iterator | find (const_reference key) const |
|
std::pair< iterator, bool > | insert (const_reference val) |
|
iterator | insert (iterator hint, const_reference val) |
|
std::pair< iterator, bool > | insert (value_type &&val) |
|
iterator | insert (iterator hint, value_type &&val) |
|
template<typename InputIterator > |
size_type | insert (InputIterator first, InputIterator last) |
|
iterator | lower_bound (const_reference key) const |
|
rw_orderedhashset & | operator= (const rw_orderedhashset &rhs) |
|
rw_orderedhashset & | operator= (rw_orderedhashset &&rhs) |
|
void | resize (size_type cap) |
|
size_type | size () const |
|
void | swap (rw_orderedhashset &other) |
|
iterator | upper_bound (const_reference key) const |
|
|
(Note that these are not member functions.)
|
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>
- 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 >
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
.
- 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
.
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 >
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.