From 6d8a78fd8829828499aca3f652e630b18a7c9b22 Mon Sep 17 00:00:00 2001 From: Daniel Ansorregui Date: Wed, 2 Feb 2022 13:11:27 +0000 Subject: [PATCH] Avoid clash with Arduino defines * Arduino defines B0/B1 in "binary.h" #define B0 0 #define B1 1 This clashes with names of the template variables in conjuction * Renaming them to "B" rather than "B1" Now it can be used as-is in Arduino projects --- include/nlohmann/detail/meta/type_traits.hpp | 8 ++++---- single_include/nlohmann/json.hpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/nlohmann/detail/meta/type_traits.hpp b/include/nlohmann/detail/meta/type_traits.hpp index 984ca1931..166509468 100644 --- a/include/nlohmann/detail/meta/type_traits.hpp +++ b/include/nlohmann/detail/meta/type_traits.hpp @@ -152,10 +152,10 @@ struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> // https://en.cppreference.com/w/cpp/types/conjunction template struct conjunction : std::true_type { }; -template struct conjunction : B1 { }; -template -struct conjunction -: std::conditional, B1>::type {}; +template struct conjunction : B { }; +template +struct conjunction +: std::conditional, B>::type {}; // https://en.cppreference.com/w/cpp/types/negation template struct negation : std::integral_constant < bool, !B::value > { }; diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index e40e3b05b..37faf1692 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -3497,10 +3497,10 @@ struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> // https://en.cppreference.com/w/cpp/types/conjunction template struct conjunction : std::true_type { }; -template struct conjunction : B1 { }; -template -struct conjunction -: std::conditional, B1>::type {}; +template struct conjunction : B { }; +template +struct conjunction +: std::conditional, B>::type {}; // https://en.cppreference.com/w/cpp/types/negation template struct negation : std::integral_constant < bool, !B::value > { };