50 #ifndef _cvc3__hash__hash_set_h_
51 #define _cvc3__hash__hash_set_h_
63 struct _Identity :
public std::unary_function<_Tp,_Tp> {
64 const _Tp&
operator()(
const _Tp& __x)
const {
return __x; }
76 template <
class _Key,
class _HashFcn = hash<_Key>,
77 class _EqualKey = std::equal_to<_Key> >
118 d_table(initial_capacity)
123 d_table(initial_capacity, hash)
128 const _HashFcn&
hash,
const _EqualKey& equal) :
129 d_table(initial_capacity, hash, equal)
134 d_table(other.d_table)
139 if (
this != &other) {
161 iterator
find(
const key_type& key) {
162 return d_table.
find(key);
166 const_iterator
find(
const key_type& key)
const {
167 return d_table.
find(key);
173 std::pair<iterator, bool>
insert(
const value_type& entry) {
174 return d_table.
insert(entry);
180 size_type
erase(
const key_type& key) {
181 return d_table.
erase(key);
195 size_type
count(
const _Key& key)
const {
196 return d_table.
count(key);
201 return d_table.
empty();
206 return d_table.
size();
225 return d_table.
begin();
230 return d_table.
begin();
236 return d_table.
end();
240 const_iterator
end()
const {
241 return d_table.
end();
_hash_table::hasher hasher
hash_set(const hash_set &other)
float load_factor() const
const_iterator begin() const
size_type count(const _Key &key) const
const_iterator end() const
void swap(hash_table &other)
_hash_table::iterator iterator
_hash_table::value_type value_type
const _Tp & operator()(const _Tp &__x) const
iterator begin()
iterators
float load_factor() const
hash_set(size_type initial_capacity, const _HashFcn &hash)
_hash_table::key_equal key_equal
size_type bucket_count() const
hash_set(size_type initial_capacity, const _HashFcn &hash, const _EqualKey &equal)
size_type erase(const key_type &key)
size_type count(const _Key &key) const
std::equal_to< Var > key_equal
_hash_table d_table
variables
iterator begin()
iterators
hash_set & operator=(const hash_set &other)
iterator find(const key_type &key)
operations
_hash_table::key_type key_type
std::pair< iterator, bool > insert(const value_type &entry)
size_type bucket_count() const
hash table implementation
friend class const_iterator
hash_table< _Key, _Key, _HashFcn, _EqualKey, _Identity< _Key > > _hash_table
types
const_iterator find(const key_type &key) const
bool contains(const key_type &key) const
status
Hash::size_type size_type
types
bool contains(const key_type &key) const
status
hash_set(size_type initial_capacity)
std::pair< iterator, bool > insert(const value_type &value)
_hash_table::const_iterator const_iterator
size_type erase(const key_type &key)
iterator find(const key_type &key)
operations
void swap(hash_set &other)
_hash_table::size_type size_type