mirror of
https://github.com/nlohmann/json.git
synced 2026-09-03 15:05:01 +00:00
@@ -86,6 +86,21 @@
|
||||
*/
|
||||
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