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

Merge pull request #2233 from nlohmann/issue2175

Add specialization of get_to
This commit is contained in:
Niels Lohmann
2020-07-06 07:58:52 +02:00
committed by GitHub
3 changed files with 41 additions and 13 deletions

View File

@ -18950,6 +18950,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],