Skip to content

Commit

Permalink
Move include of optional out of macro_scope; probably does not make s…
Browse files Browse the repository at this point in the history
…ense to be there
  • Loading branch information
fsandhei committed Nov 14, 2024
1 parent a83e523 commit 4341bef
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions include/nlohmann/detail/conversions/from_json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@
#include <forward_list> // forward_list
#include <iterator> // inserter, front_inserter, end
#include <map> // map
#ifdef JSON_HAS_CPP_17
#include <optional> // optional
#endif
#include <string> // string
#include <tuple> // tuple, make_tuple
#include <type_traits> // is_arithmetic, is_same, is_enum, underlying_type, is_convertible
#include <unordered_map> // unordered_map
#include <utility> // pair, declval
#include <valarray> // valarray


#include <nlohmann/detail/exceptions.hpp>
#include <nlohmann/detail/macro_scope.hpp>
#include <nlohmann/detail/meta/cpp_future.hpp>
Expand Down
3 changes: 3 additions & 0 deletions include/nlohmann/detail/conversions/to_json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

#include <algorithm> // copy
#include <iterator> // begin, end
#ifdef JSON_HAS_CPP_17
#include <optional> // optional
#endif
#include <string> // string
#include <tuple> // tuple, get
#include <type_traits> // is_same, is_constructible, is_floating_point, is_enum, underlying_type
Expand Down
4 changes: 0 additions & 4 deletions include/nlohmann/detail/macro_scope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@
#define JSON_HAS_CPP_11
#endif

#ifdef JSON_HAS_CPP_17
#include <optional>
#endif

#ifdef __has_include
#if __has_include(<version>)
#include <version>
Expand Down
11 changes: 7 additions & 4 deletions single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,17 @@
#include <forward_list> // forward_list
#include <iterator> // inserter, front_inserter, end
#include <map> // map
#ifdef JSON_HAS_CPP_17
#include <optional> // optional
#endif
#include <string> // string
#include <tuple> // tuple, make_tuple
#include <type_traits> // is_arithmetic, is_same, is_enum, underlying_type, is_convertible
#include <unordered_map> // unordered_map
#include <utility> // pair, declval
#include <valarray> // valarray


// #include <nlohmann/detail/exceptions.hpp>
// __ _____ _____ _____
// __| | __| | | | JSON for Modern C++
Expand Down Expand Up @@ -2505,10 +2509,6 @@ JSON_HEDLEY_DIAGNOSTIC_POP
#define JSON_NO_UNIQUE_ADDRESS
#endif

#ifdef JSON_HAS_CPP_17
#include <optional>
#endif

// disable documentation warnings on clang
#if defined(__clang__)
#pragma clang diagnostic push
Expand Down Expand Up @@ -5184,6 +5184,9 @@ NLOHMANN_JSON_NAMESPACE_END

#include <algorithm> // copy
#include <iterator> // begin, end
#ifdef JSON_HAS_CPP_17
#include <optional> // optional
#endif
#include <string> // string
#include <tuple> // tuple, get
#include <type_traits> // is_same, is_constructible, is_floating_point, is_enum, underlying_type
Expand Down

0 comments on commit 4341bef

Please sign in to comment.