diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h index 9f1b05a..55cc02a 100644 --- a/include/jwt-cpp/jwt.h +++ b/include/jwt-cpp/jwt.h @@ -23,10 +23,12 @@ #include #include #include - -#ifdef __cpp_lib_void_t -// We have std::void_t and std::make_void #include + +#ifdef __has_include +#if __has_include() +#include +#endif #endif //If openssl version less than 1.1 @@ -826,8 +828,6 @@ namespace jwt { } // namespace json namespace details { - namespace impl { - #ifdef __cpp_lib_void_t template using void_t = std::void_t; @@ -842,6 +842,14 @@ namespace jwt { template using void_t = typename make_void::type; #endif + +#ifdef __cpp_lib_experimental_detect + template class _Op, typename... _Args> + using is_detected = std::experimental::is_detected<_Op, _Args...>; + + template class _Op, typename... _Args> + using is_detected_t = std::experimental::detected_t<_Op, _Args...>; +#else struct nonesuch { nonesuch() = delete; @@ -866,13 +874,13 @@ namespace jwt { using value = std::true_type; using type = Op; }; - } // namespace impl template