diff --git a/src/Collections/Dictionary.hpp b/src/Collections/Dictionary.hpp index 77aaec8..d5af343 100644 --- a/src/Collections/Dictionary.hpp +++ b/src/Collections/Dictionary.hpp @@ -26,6 +26,16 @@ namespace ArbUt { /// @brief Initialises a dictionary from an initializer_list. Dictionary(const std::initializer_list>& l) : _map(new std::unordered_map(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(); }