diff options
author | Maxim Pimenov <m@maps.me> | 2016-04-26 20:48:19 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2016-05-01 10:28:03 +0300 |
commit | 861cdb910ca40f48dbaf8e096707f0b3b912bb42 (patch) | |
tree | 9599e020017dde614929b28a07aceead73363319 /base | |
parent | 0b20c90890459444778897c1fa5cd6a68538f30a (diff) |
[editor] Implemented search of a category for a newly added object.
Diffstat (limited to 'base')
-rw-r--r-- | base/mem_trie.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/base/mem_trie.hpp b/base/mem_trie.hpp index a37ed25e0e..9cdcc29755 100644 --- a/base/mem_trie.hpp +++ b/base/mem_trie.hpp @@ -15,6 +15,12 @@ class MemTrie public: MemTrie() = default; + MemTrie(MemTrie && other) : m_root(move(other.m_root)) + { + m_numNodes = other.m_numNodes; + other.m_numNodes = 0; + } + // Adds a key-value pair to the trie. void Add(TString const & key, TValue const & value) { @@ -53,6 +59,8 @@ private: Node() = default; + Node(Node && other) = default; + ~Node() { for (auto const & move : m_moves) @@ -76,7 +84,7 @@ private: map<TChar, Node *> m_moves; vector<TValue> m_values; - DISALLOW_COPY_AND_MOVE(Node); + DISALLOW_COPY(Node); }; Node const * MoveTo(TString const & key) const @@ -112,6 +120,6 @@ private: Node m_root; size_t m_numNodes = 0; - DISALLOW_COPY_AND_MOVE(MemTrie); + DISALLOW_COPY(MemTrie); }; // class MemTrie } // namespace my |