1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00

🚑 add specialization of get_to #2175

This commit is contained in:
Niels Lohmann
2020-06-30 14:26:52 +02:00
parent eb7376bb13
commit c7e079cc98
3 changed files with 41 additions and 11 deletions

View File

@ -18949,6 +18949,18 @@ class basic_json
return v;
}
// specialization to allow to call get_to with a basic_json value
// see https://github.com/nlohmann/json/issues/2175
template<typename ValueType,
detail::enable_if_t <
detail::is_basic_json<ValueType>::value,
int> = 0>
ValueType & get_to(ValueType& v) const
{
v = *this;
return v;
}
template <
typename T, std::size_t N,
typename Array = T (&)[N],