mirror of
https://github.com/nlohmann/json.git
synced 2026-10-19 12:38:12 +00:00
3 files changed
+34
No files matched your search
@@ -13,6 +13,9 @@
|
||||
#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
|
||||
@@ -77,6 +80,15 @@ 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 //
|
||||
//////////////////////////
|
||||
|
||||
Reference in new issue
Block a user