52# include <initializer_list>
59 template <
typename Key,
79 Key &
get_first()
const {
return this->get_it().get_curr(); }
83 auto it = this->get_it();
106 <
typename Key,
typename Data,
114 void add(std::initializer_list<Key>
lk, std::initializer_list<Data> ld)
117 <<
"size mismatch between domain and range";
119 auto itk =
lk.begin();
120 auto itd = ld.begin();
127 HashMap(std::initializer_list<Key>
lk, std::initializer_list<Data> ld)
137 <<
"size mismatch between domain and range";
139 auto itd = ld.begin();
140 c.for_each( [
this, &
itd](
const Key & key)
142 set_entry(key, *
itd++);
155 using Base::contains;
169 template <
typename Key,
178 template <
typename Key,
typename Data,
Exception handling system with formatted messages for Aleph-w.
#define ah_range_error_if(C)
Throws std::range_error if condition holds.
#define Generate_Proxy_Operator(Class_Name)
Generates operator[] for map-like containers.
#define Special_Ctors(Set_Type, Type)
Generates special constructors for containers.
Dynamic singly linked list with functional programming support.
Open addressing hash table with linear probing collision resolution.
void for_each(Operation &operation)
Traverse all the container and performs an operation on each element.
Main namespace for Aleph-w library functions.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
HashMapTable< Key, Data, Cmp > Base
void add(std::initializer_list< Key > lk, std::initializer_list< Data > ld)
bool is_empty() const noexcept
Checks if the container is empty.
void clear()
Empties the container.
HashMap(const Container< Key > &c, std::initializer_list< Data > ld)
HashMap(std::initializer_list< Key > lk, std::initializer_list< Data > ld)
void clear()
Empties the container.
void add(const DynList< Key > &l)
bool is_empty() const noexcept
Checks if the container is empty.
HashSetTable< Key, Cmp > Base
Open addressing hash map using linear probing.
Dynamic map with open hashing.
Dynamic set implementations based on hash tables.