Skip to content

Commit

Permalink
Fix check for front() in array_type
Browse files Browse the repository at this point in the history
Signed-off-by: Omar Mohamed <[email protected]>
  • Loading branch information
omar-mohamed-khallaf committed Sep 30, 2024
1 parent 70f0250 commit 4597a64
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/jwt-cpp/jwt.h
Original file line number Diff line number Diff line change
Expand Up @@ -2459,12 +2459,15 @@ namespace jwt {
struct is_valid_json_array {
template<typename T>
using value_type_t = typename T::value_type;
using front_return_type = decltype(std::declval<array_type>().front());
using front_base_type =
typename std::remove_cv<typename std::remove_reference<front_return_type>::type>::type;

static constexpr auto value = std::is_constructible<value_type, array_type>::value &&
is_iterable<array_type>::value &&
is_detected<value_type_t, array_type>::value &&
std::is_same<typename array_type::value_type, value_type>::value &&
std::is_member_function_pointer<decltype(&array_type::front)>::value;
std::is_same<front_base_type, value_type>::value;
};

template<typename string_type, typename integer_type>
Expand Down

0 comments on commit 4597a64

Please sign in to comment.