36 string a =
"hello world";
38 Foo(
const string & str) :
a(str) {}
46 return p1.first == p2.first;
70 for (
size_t i = 0; i < 1000; ++i)
76 static_cast<void>(
m.
insert(make_pair(make_pair(f1.get(), f2.get()),
77 f1->a +
" " + f2->a)));
79 for (
auto it =
foos.get_it(); it.has_curr(); it.next())
81 auto f1 = it.get_curr().get();
82 for (
auto it =
foos.get_it(); it.has_curr(); it.next())
83 static_cast<void>(
m.
insert(make_pair(make_pair(f1, it.get_curr().get()),
84 f1->a +
" " + it.get_curr()->a)));
87 for (
auto it =
foos.get_it(); it.has_curr(); it.next())
89 auto f1 = it.get_curr().get();
90 for (
auto it =
foos.get_it(); it.has_curr(); it.next())
91 m.
remove(make_pair(make_pair(f1, it.get_curr().get()),
""));
94 for (
auto it =
m.
get_it(); it.has_curr(); it.next())
96 auto p = it.get_curr();
97 cout << p.second <<
endl;
T & append()
Allocate a new entry to the end of array.
Open addressing hash table with double hashing collision resolution.
void remove(const Key &key)
Remove a key from the hash table.
auto get_it() const
Return a properly initialized iterator positioned at the first item on the container.
Key * insert(const Key &key)
Inserts a key into the hash table (copy version).
size_t pair_snd_hash_fct(const std::pair< K1, K2 > &p) noexcept
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.
std::pair< First, Second > pair
Alias to std::pair kept for backwards compatibility.
size_t pair_dft_hash_fct(const std::pair< K1, K2 > &p) noexcept
std::string to_string(const time_t t, const std::string &format)
Format a time_t value into a string using format.
bool operator()(const pair< pair< const Foo *, const Foo * >, string > &p1, const pair< pair< const Foo *, const Foo * >, string > &p2) const
static size_t fst_unit_pair_hash(const pair< pair< const Foo *, const Foo * >, string > &p)
static size_t snd_unit_pair_hash(const pair< pair< const Foo *, const Foo * >, string > &p)
FooMap m(5, fst_unit_pair_hash, snd_unit_pair_hash)
Open addressing hash table with double hashing.