50 #ifndef _cvc3__hash__hash_map_h_
51 #define _cvc3__hash__hash_map_h_
63 template <
class _Pair>
64 struct _Select1st :
public std::unary_function<_Pair, typename _Pair::first_type> {
65 const typename _Pair::first_type&
operator()(
const _Pair& __x)
const {
80 template <
class _Key,
class _Data,
class _HashFcn = hash<_Key>,
81 class _EqualKey = std::equal_to<_Key> >
128 d_table(initial_capacity)
133 d_table(initial_capacity, hash)
138 const _HashFcn&
hash,
const _EqualKey& equal) :
139 d_table(initial_capacity, hash, equal)
144 d_table(other.d_table)
149 if (
this != &other) {
171 iterator
find(
const key_type& key) {
172 return d_table.
find(key);
176 const_iterator
find(
const key_type& key)
const {
177 return d_table.
find(key);
190 std::pair<iterator, bool>
insert(
const value_type& entry) {
191 return d_table.
insert(entry);
197 size_type
erase(
const key_type& key) {
198 return d_table.
erase(key);
203 const_iterator
erase(
const const_iterator& i) {
204 return d_table.
erase(i);
217 size_type
count(
const _Key& key)
const {
218 return d_table.
count(key);
223 return d_table.
empty();
228 return d_table.
size();
247 return d_table.
begin();
252 return d_table.
begin();
258 return d_table.
end();
262 const_iterator
end()
const {
263 return d_table.
end();
_hash_table::iterator iterator
size_type count(const _Key &key) const
const_iterator find(const key_type &key) const
std::pair< const long, int > value_type
const_iterator end() const
void swap(hash_table &other)
hash_map(const hash_map &other)
iterator begin()
iterators
hash_map(size_type initial_capacity, const _HashFcn &hash, const _EqualKey &equal)
data_type & operator[](const key_type &key)
_hash_table::key_type key_type
_hash_table::const_iterator const_iterator
float load_factor() const
const _Pair::first_type & operator()(const _Pair &__x) const
iterator find(const key_type &key)
operations
size_type erase(const key_type &key)
bool contains(const key_type &key) const
status
float load_factor() const
_hash_table::size_type size_type
_hash_table::hasher hasher
iterator begin()
iterators
void swap(hash_map &other)
hash_map(size_type initial_capacity, const _HashFcn &hash)
size_type count(const _Key &key) const
std::pair< iterator, bool > insert(const value_type &entry)
std::equal_to< long > key_equal
iterator find(const key_type &key)
operations
const_iterator begin() const
hash_map(size_type initial_capacity)
size_type bucket_count() const
size_type bucket_count() const
value_type & find_or_insert(const value_type &value)
hash_map & operator=(const hash_map &other)
hash table implementation
friend class const_iterator
_hash_table::value_type value_type
bool contains(const key_type &key) const
status
Hash::size_type size_type
types
_hash_table d_table
variables
std::pair< iterator, bool > insert(const value_type &value)
size_type erase(const key_type &key)
hash_table< _Key, std::pair< const _Key, _Data >, _HashFcn, _EqualKey, _Select1st< std::pair< const _Key, _Data > > > _hash_table
types
_hash_table::key_equal key_equal
const_iterator erase(const const_iterator &i)