From 9a459e1bd5b2bbbb5f119085e7d56153cb24638c Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 30 Jul 2021 15:20:22 +0200 Subject: [PATCH] :rotating_light: fix useless-cast warnings --- include/nlohmann/detail/meta/type_traits.hpp | 4 ++-- single_include/nlohmann/json.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/nlohmann/detail/meta/type_traits.hpp b/include/nlohmann/detail/meta/type_traits.hpp index 4ee945cc9..ee028b5d2 100644 --- a/include/nlohmann/detail/meta/type_traits.hpp +++ b/include/nlohmann/detail/meta/type_traits.hpp @@ -437,13 +437,13 @@ template struct is_constructible_tuple> : conjunction...> {}; // to avoid useless casts (see https://github.com/nlohmann/json/issues/2893#issuecomment-889152324) -template < typename T, typename U, std::enable_if_t < !std::is_same::value, int > = 0 > +template < typename T, typename U, enable_if_t < !std::is_same::value, int > = 0 > T conditional_static_cast(U value) { return static_cast(value); } -template::value, int> = 0> +template::value, int> = 0> T conditional_static_cast(U value) { return value; diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 07c1e1ab4..28ce55292 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -3837,13 +3837,13 @@ template struct is_constructible_tuple> : conjunction...> {}; // to avoid useless casts (see https://github.com/nlohmann/json/issues/2893#issuecomment-889152324) -template < typename T, typename U, std::enable_if_t < !std::is_same::value, int > = 0 > +template < typename T, typename U, enable_if_t < !std::is_same::value, int > = 0 > T conditional_static_cast(U value) { return static_cast(value); } -template::value, int> = 0> +template::value, int> = 0> T conditional_static_cast(U value) { return value;