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
This commit is contained in:
parent
b63a6edb24
commit
ea214727a5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user