Commit ea214727 authored by Mark Olesen's avatar Mark Olesen Committed by Andrew Heather
Browse files

ENH: 'set' instead of 'insert' std::initializer_list to HashTable

- Duplicate entries are handled by overwriting, which corresponds more
  closely to the notion of assignment
parent b63a6edb
......@@ -97,7 +97,7 @@ Foam::HashTable<T, Key, Hash>::HashTable
{
for (const auto& keyval : list)
{
insert(keyval.first, keyval.second);
set(keyval.first, keyval.second);
}
}
......@@ -809,7 +809,7 @@ void Foam::HashTable<T, Key, Hash>::operator=
for (const auto& keyval : rhs)
{
insert(keyval.first, keyval.second);
set(keyval.first, keyval.second);
}
}
......
......@@ -222,6 +222,7 @@ public:
HashTable(this_type&& rhs);
//- Construct from an initializer list
// Duplicate entries are handled by overwriting
HashTable(std::initializer_list<std::pair<Key, T>> list);
......@@ -518,6 +519,7 @@ public:
void operator=(const this_type& rhs);
//- Copy assign from an initializer list
// Duplicate entries are handled by overwriting
void operator=(std::initializer_list<std::pair<Key, T>> rhs);
//- Move assign
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment