From 4f5208bf99307a97cbcb751dbade4b41773eda4c Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Sun, 6 Sep 2020 16:31:34 -0300 Subject: [PATCH] Add methods to allow usage of GenericMap's accessors with "auto" keyword. --- src/common/classes/GenericMap.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/common/classes/GenericMap.h b/src/common/classes/GenericMap.h index 230f8e1979..6923c73faf 100644 --- a/src/common/classes/GenericMap.h +++ b/src/common/classes/GenericMap.h @@ -75,9 +75,6 @@ public: bool fastRemove() { return m_Accessor.fastRemove(); } private: - Accessor(const Accessor&); - Accessor& operator=(const Accessor&); - TreeAccessor m_Accessor; }; @@ -94,9 +91,6 @@ public: ValueType* locate(const KeyType& key) { return m_Accessor.locate(key); } private: - ConstAccessor(const ConstAccessor&); - ConstAccessor& operator=(const ConstAccessor&); - ConstTreeAccessor m_Accessor; }; @@ -254,6 +248,16 @@ public: size_t count() const { return mCount; } + Accessor accessor() + { + return Accessor(this); + } + + ConstAccessor constAccessor() const + { + return ConstAccessor(this); + } + private: ValuesTree tree; size_t mCount;