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)), value_ref(&owned_value), is_rvalue(
true)
23 : value_ref(
const_cast<value_type*
>(&value)), is_rvalue(
false)
26 json_ref(std::initializer_list<json_ref> init)
27 : owned_value(init), value_ref(&owned_value), is_rvalue(
true)
32 enable_if_t<std::is_constructible<value_type, Args...>::value,
int> = 0 >
34 : owned_value(std::forward<Args>(args)...), value_ref(&owned_value),
44 value_type moved_or_copied()
const
48 return std::move(*value_ref);
53 value_type
const& operator*()
const
55 return *
static_cast<value_type const*
>(value_ref);
58 value_type
const* operator->()
const
60 return static_cast<value_type const*
>(value_ref);
64 mutable value_type owned_value =
nullptr;
65 value_type* value_ref =
nullptr;
Definition: json_ref.hpp:14
namespace for Niels Lohmann
Definition: adl_serializer.hpp:9