parent
e426219256
commit
11fecc25af
3 changed files with 33 additions and 8 deletions
|
@ -3,6 +3,8 @@
|
|||
#include <initializer_list>
|
||||
#include <utility>
|
||||
|
||||
#include <nlohmann/detail/meta/type_traits.hpp>
|
||||
|
||||
namespace nlohmann
|
||||
{
|
||||
namespace detail
|
||||
|
@ -25,10 +27,12 @@ class json_ref
|
|||
: owned_value(init), value_ref(&owned_value), is_rvalue(true)
|
||||
{}
|
||||
|
||||
template<class... Args>
|
||||
json_ref(Args&& ... args)
|
||||
: owned_value(std::forward<Args>(args)...), value_ref(&owned_value), is_rvalue(true)
|
||||
{}
|
||||
template <
|
||||
class... Args,
|
||||
enable_if_t<std::is_constructible<value_type, Args...>::value, int> = 0 >
|
||||
json_ref(Args && ... args)
|
||||
: owned_value(std::forward<Args>(args)...), value_ref(&owned_value),
|
||||
is_rvalue(true) {}
|
||||
|
||||
// class should be movable only
|
||||
json_ref(json_ref&&) = default;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue