Skip to content

Commit ff7ed18

Browse files
author
Théo Delrieu
committed
optional: use #if instead of #ifndef, fixes nlohmann#3859
1 parent a006a7a commit ff7ed18

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

include/nlohmann/detail/conversions/from_json.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ inline void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
4848
}
4949

5050
#ifdef JSON_HAS_CPP_17
51-
#ifndef JSON_USE_IMPLICIT_CONVERSIONS
51+
#if !JSON_USE_IMPLICIT_CONVERSIONS
5252
template<typename BasicJsonType, typename T>
5353
void from_json(const BasicJsonType& j, std::optional<T>& opt)
5454
{

single_include/nlohmann/json.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4721,7 +4721,7 @@ inline void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
47214721
}
47224722

47234723
#ifdef JSON_HAS_CPP_17
4724-
#ifndef JSON_USE_IMPLICIT_CONVERSIONS
4724+
#if !JSON_USE_IMPLICIT_CONVERSIONS
47254725
template<typename BasicJsonType, typename T>
47264726
void from_json(const BasicJsonType& j, std::optional<T>& opt)
47274727
{

tests/src/unit-conversions.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ TEST_CASE("JSON to enum mapping")
15981598

15991599

16001600
#ifdef JSON_HAS_CPP_17
1601-
#ifndef JSON_USE_IMPLICIT_CONVERSIONS
1601+
#if !JSON_USE_IMPLICIT_CONVERSIONS
16021602
TEST_CASE("std::optional")
16031603
{
16041604
SECTION("null")

0 commit comments

Comments
 (0)