From d8574ff2b8526f3c22f3ff316d98b6e7859a6269 Mon Sep 17 00:00:00 2001 From: Ali Girayhan Ozbay Date: Tue, 12 Aug 2025 11:57:40 +0100 Subject: [PATCH 1/2] add interfaces for jwt cpp compatibility --- include/rfl/Object.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/rfl/Object.hpp b/include/rfl/Object.hpp index eb888374..ff57d059 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 noexcept { return find(key) == size() ? 0 : 1; } + /// The maximum possible size. auto max_size() const { return data_.max_size(); } From 31e8f3a11c59c32784d6c6a87c5608ed35137e87 Mon Sep 17 00:00:00 2001 From: aligirayhanozbay <44897017+aligirayhanozbay@users.noreply.github.com> Date: Tue, 12 Aug 2025 12:49:40 +0100 Subject: [PATCH 2/2] Update include/rfl/Object.hpp Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- include/rfl/Object.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rfl/Object.hpp b/include/rfl/Object.hpp index ff57d059..9a02be19 100644 --- a/include/rfl/Object.hpp +++ b/include/rfl/Object.hpp @@ -90,7 +90,7 @@ 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 noexcept { return find(key) == size() ? 0 : 1; } + 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(); }