Skip to content

Commit

Permalink
adding extra check
Browse files Browse the repository at this point in the history
low laptop battery rip me
  • Loading branch information
prince-chrismc committed May 22, 2020
1 parent ddffc6c commit 659de08
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions include/jwt-cpp/jwt.h
Original file line number Diff line number Diff line change
Expand Up @@ -811,14 +811,19 @@ namespace jwt {

template <typename T>
using get_type_t = decltype(T::get_type);

template <typename T>
using supports_get_type = is_detected<get_type_t, T>;

template <typename T>
using as_object_t = decltype(T::as_object);
template <typename T>
using supports_as_object = is_detected<as_object_t, T>;

template<typename T>
struct is_json_traits {
static constexpr auto value =
supports_get_type<T>::value;
static constexpr auto value =
supports_get_type<T>::value &&
supports_as_object<T>::value;
};

struct picojson_traits {
Expand Down

0 comments on commit 659de08

Please sign in to comment.