diff --git a/include/rfl/Object.hpp b/include/rfl/Object.hpp index eb888374..9a02be19 100644 --- a/include/rfl/Object.hpp +++ b/include/rfl/Object.hpp @@ -90,6 +90,8 @@ class Object { /// The number of elements currently inside the object. auto size() const { return data_.size(); } + std::size_t count(const key_type& key) const { return std::count_if(cbegin(), cend(), [&](const auto& p) { return p.first == key; }); } + /// The maximum possible size. auto max_size() const { return data_.max_size(); }