diff options
Diffstat (limited to 'modules/core')
-rw-r--r-- | modules/core/c++/id_map.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/core/c++/id_map.hpp b/modules/core/c++/id_map.hpp index e1c1b3f..1df2178 100644 --- a/modules/core/c++/id_map.hpp +++ b/modules/core/c++/id_map.hpp @@ -140,6 +140,11 @@ public: return void_t{}; } + /** + * Tries to find a value based on an id. + * Returns an error on failure and returns + * a value pointer on success. + */ error_or<T*> find(const id<T>& val){ if(val.get_value() >= data_.size()){ return make_error<err::not_found>("ID is too large"); |