Skip to content

Commit 93bc206

Browse files
committed
Fix include <cstddef> only when __cpp_lib_byte is defined and sufficient
Signed-off-by: yexiaochuan <tap91624@gmail.com>
1 parent f5b8c80 commit 93bc206

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

include/nlohmann/detail/meta/type_traits.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
#include <tuple> // tuple
1414
#include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type
1515
#include <utility> // declval
16-
#include <cstddef> // byte
17-
16+
#if defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603L
17+
#include <cstddef> // byte
18+
#endif
1819
#include <nlohmann/detail/iterators/iterator_traits.hpp>
1920
#include <nlohmann/detail/macro_scope.hpp>
2021
#include <nlohmann/detail/meta/call_std/begin.hpp>

single_include/nlohmann/json.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3367,8 +3367,9 @@ NLOHMANN_JSON_NAMESPACE_END
33673367
#include <tuple> // tuple
33683368
#include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type
33693369
#include <utility> // declval
3370-
#include <cstddef> // byte
3371-
3370+
#if defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603L
3371+
#include <cstddef> // byte
3372+
#endif
33723373
// #include <nlohmann/detail/iterators/iterator_traits.hpp>
33733374
// __ _____ _____ _____
33743375
// __| | __| | | | JSON for Modern C++

0 commit comments

Comments
 (0)