diff --git a/include/nlohmann/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp index 522292247f..42240ea28d 100644 --- a/include/nlohmann/detail/conversions/from_json.hpp +++ b/include/nlohmann/detail/conversions/from_json.hpp @@ -48,7 +48,7 @@ inline void from_json(const BasicJsonType& j, typename std::nullptr_t& n) } #ifdef JSON_HAS_CPP_17 -#ifndef JSON_USE_IMPLICIT_CONVERSIONS +#if !JSON_USE_IMPLICIT_CONVERSIONS template void from_json(const BasicJsonType& j, std::optional& opt) { diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 02441416bf..e45958b819 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -4721,7 +4721,7 @@ inline void from_json(const BasicJsonType& j, typename std::nullptr_t& n) } #ifdef JSON_HAS_CPP_17 -#ifndef JSON_USE_IMPLICIT_CONVERSIONS +#if !JSON_USE_IMPLICIT_CONVERSIONS template void from_json(const BasicJsonType& j, std::optional& opt) { diff --git a/tests/src/unit-conversions.cpp b/tests/src/unit-conversions.cpp index 9adbc935af..a713c93aa1 100644 --- a/tests/src/unit-conversions.cpp +++ b/tests/src/unit-conversions.cpp @@ -1598,7 +1598,7 @@ TEST_CASE("JSON to enum mapping") #ifdef JSON_HAS_CPP_17 -#ifndef JSON_USE_IMPLICIT_CONVERSIONS +#if !JSON_USE_IMPLICIT_CONVERSIONS TEST_CASE("std::optional") { SECTION("null")