From feaca3cc8541e49b3508fdd07abe83851f858c91 Mon Sep 17 00:00:00 2001 From: Omar Mohamed Date: Sun, 29 Sep 2024 11:37:13 +0300 Subject: [PATCH] Add `front()` to jsoncons array_type --- include/jwt-cpp/traits/danielaparker-jsoncons/traits.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/jwt-cpp/traits/danielaparker-jsoncons/traits.h b/include/jwt-cpp/traits/danielaparker-jsoncons/traits.h index 835d0201d..a2ae2c5eb 100644 --- a/include/jwt-cpp/traits/danielaparker-jsoncons/traits.h +++ b/include/jwt-cpp/traits/danielaparker-jsoncons/traits.h @@ -61,7 +61,12 @@ namespace jwt { return 0; } }; - using array_type = json::array; + class array_type : public json::array { + public: + value_type& front() { return this->operator[](0U); } + + value_type const& front() const { return this->operator[](0U); } + }; using string_type = std::string; // current limitation of traits implementation using number_type = double; using integer_type = int64_t;