From f85ea4ae3cb991aa593f842496639720084f1277 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 13 Sep 2019 12:28:19 +0200 Subject: BLI: add non-const lookup methods for StringMap --- source/blender/blenlib/BLI_string_map.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source') diff --git a/source/blender/blenlib/BLI_string_map.h b/source/blender/blenlib/BLI_string_map.h index 0cf0bb40e4d..e7eb1e2635e 100644 --- a/source/blender/blenlib/BLI_string_map.h +++ b/source/blender/blenlib/BLI_string_map.h @@ -248,6 +248,11 @@ template class StringMap { ITER_SLOTS_END(offset); } + T &lookup(StringRef key) + { + return const_cast(const_cast(this)->lookup(key)); + } + /** * Get a pointer to the value corresponding to the key. Return nullptr, if the key does not * exist. @@ -266,6 +271,11 @@ template class StringMap { ITER_SLOTS_END(offset); } + T *lookup_ptr(StringRef key) + { + return const_cast(const_cast(this)->lookup_ptr(key)); + } + /** * Get a copy of the value corresponding to the key. If the key does not exist, return the * default value. -- cgit v1.2.3