3 #include <initializer_list>
6 #include <nlohmann/detail/meta/type_traits.hpp>
12 template<
typename BasicJsonType>
16 using value_type = BasicJsonType;
19 : owned_value(std::move(
value))
20 , value_ref(&owned_value)
25 : value_ref(
const_cast<value_type*
>(&
value))
29 json_ref(std::initializer_list<json_ref> init)
31 , value_ref(&owned_value)
37 enable_if_t<std::is_constructible<value_type, Args...>::value,
int> = 0 >
39 : owned_value(std::forward<Args>(args)...)
40 , value_ref(&owned_value)
51 value_type moved_or_copied()
const
55 return std::move(*value_ref);
60 value_type
const& operator*()
const
62 return *
static_cast<value_type const*
>(value_ref);
65 value_type
const* operator->()
const
67 return static_cast<value_type const*
>(value_ref);
71 mutable value_type owned_value =
nullptr;
72 value_type* value_ref =
nullptr;
73 const bool is_rvalue =
true;
Definition: json_ref.hpp:14
@ value
the parser finished reading a JSON value
namespace for Niels Lohmann
Definition: adl_serializer.hpp:9