BLI: add non-const lookup methods for StringMap
This commit is contained in:
parent
08539312b2
commit
f85ea4ae3c
|
@ -248,6 +248,11 @@ template<typename T, typename Allocator = GuardedAllocator> class StringMap {
|
|||
ITER_SLOTS_END(offset);
|
||||
}
|
||||
|
||||
T &lookup(StringRef key)
|
||||
{
|
||||
return const_cast<T &>(const_cast<const StringMap *>(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<typename T, typename Allocator = GuardedAllocator> class StringMap {
|
|||
ITER_SLOTS_END(offset);
|
||||
}
|
||||
|
||||
T *lookup_ptr(StringRef key)
|
||||
{
|
||||
return const_cast<T *>(const_cast<const StringMap *>(this)->lookup_ptr(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a copy of the value corresponding to the key. If the key does not exist, return the
|
||||
* default value.
|
||||
|
|
Loading…
Reference in New Issue