mirror of
https://github.com/nlohmann/json.git
synced 2026-09-03 15:05:01 +00:00
@@ -3570,9 +3570,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
||||
#include <tuple> // tuple
|
||||
#include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type
|
||||
#include <utility> // declval
|
||||
#if defined(__cpp_lib_optional) && __cpp_lib_optional >= 201606L
|
||||
#include <optional> // optional
|
||||
#endif
|
||||
#if defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603L
|
||||
#include <cstddef> // byte
|
||||
#endif
|
||||
@@ -3820,15 +3817,6 @@ struct is_json_ref : std::false_type {};
|
||||
template<typename T>
|
||||
struct is_json_ref<json_ref<T>> : std::true_type {};
|
||||
|
||||
// trait to detect std::optional<T> specializations
|
||||
template<typename>
|
||||
struct is_std_optional : std::false_type {};
|
||||
|
||||
#if defined(__cpp_lib_optional) && __cpp_lib_optional >= 201606L
|
||||
template<typename T>
|
||||
struct is_std_optional<std::optional<T>> : std::true_type {};
|
||||
#endif
|
||||
|
||||
//////////////////////////
|
||||
// aliases for detected //
|
||||
//////////////////////////
|
||||
@@ -20607,6 +20595,21 @@ NLOHMANN_JSON_NAMESPACE_END
|
||||
*/
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
|
||||
namespace detail
|
||||
{
|
||||
// Trait to detect std::optional<T> specializations. It is defined here rather
|
||||
// than in type_traits.hpp so that adding the <optional> include does not change
|
||||
// the include order of the C++20 module's global module fragment (the include
|
||||
// is already pulled in by the conversion headers above); see src/modules/json.cppm.
|
||||
template<typename>
|
||||
struct is_std_optional : std::false_type {};
|
||||
|
||||
#ifdef JSON_HAS_CPP_17
|
||||
template<typename T>
|
||||
struct is_std_optional<std::optional<T>> : std::true_type {};
|
||||
#endif
|
||||
} // namespace detail
|
||||
|
||||
/*!
|
||||
@brief a class to store JSON values
|
||||
|
||||
|
||||
Reference in New Issue
Block a user