parent
74e3cb36a7
commit
94ca0327ef
src/Collections
|
@ -26,6 +26,16 @@ namespace ArbUt {
|
|||
/// @brief Initialises a dictionary from an initializer_list.
|
||||
Dictionary(const std::initializer_list<std::pair<const KeyT, ValueT>>& l)
|
||||
: _map(new std::unordered_map<KeyT, ValueT>(l)) {}
|
||||
/// @brief Copy operator
|
||||
Dictionary(const Dictionary& other) noexcept : _map(other._map) {}
|
||||
/// @brief Assignment operator
|
||||
Dictionary& operator=(const Dictionary& other) noexcept {
|
||||
if (this == &other || _map == other._map) {
|
||||
return *this;
|
||||
}
|
||||
_map = other._map;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// @brief Removes all items from the dictionary.
|
||||
inline void Clear() noexcept { _map->clear(); }
|
||||
|
|
Loading…
Reference in New Issue