mirror of
https://github.com/nlohmann/json.git
synced 2025-08-07 18:02:57 +03:00
add built-in array support in get_to
This commit is contained in:
@@ -2684,6 +2684,19 @@ class basic_json
|
||||
return v;
|
||||
}
|
||||
|
||||
template <
|
||||
typename T, std::size_t N,
|
||||
typename Array = T (&)[N],
|
||||
detail::enable_if_t <
|
||||
detail::has_from_json<basic_json_t, Array>::value, int > = 0 >
|
||||
Array get_to(T (&v)[N]) const
|
||||
noexcept(noexcept(JSONSerializer<Array>::from_json(
|
||||
std::declval<const basic_json_t&>(), v)))
|
||||
{
|
||||
JSONSerializer<Array>::from_json(*this, v);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
@brief get a pointer value (implicit)
|
||||
|
Reference in New Issue
Block a user