From 5177c86d1fb540c545d71106fff04da11368dda4 Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Tue, 26 May 2020 09:40:00 -0400 Subject: [PATCH] [skip ci] attempting to decay func args... --- include/jwt-cpp/jwt.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h index 3ca44be..62c61dc 100644 --- a/include/jwt-cpp/jwt.h +++ b/include/jwt-cpp/jwt.h @@ -895,6 +895,22 @@ namespace jwt { is_as_integer_signature::value; }; + template + struct types { + using type = types; + }; + + template struct function_signature : std::false_type {}; + + template + struct function_signature : std::true_type { + using args_t = typename std::decay::type; + using return_t = typename std::decay::type; + using signature_t = return_t(args_t); + }; + + template struct function_signature : function_signature {}; + template using as_boolean_function = decltype(T::as_bool); @@ -1022,6 +1038,8 @@ namespace jwt { static_assert(details::supports_as_integer::value, "traits must provide `integer_type as_int(const value_type&)`"); static_assert(details::supports_as_boolean::value, "traits must provide `boolean_type as_bool(const value_type&)`"); + static_assert(std::is_same>::args_t, value_type>::value, ""); + value_type val; public: using set_t = std::set;