Merge pull request #508 from theodelrieu/feature/c_array_conversion
add to_json method for C arrays
This commit is contained in:
commit
773b33e016
3 changed files with 511 additions and 1031 deletions
1521
src/json.hpp
1521
src/json.hpp
File diff suppressed because it is too large
Load diff
|
@ -798,6 +798,13 @@ void to_json(BasicJsonType& j, const CompatibleObjectType& arr)
|
|||
external_constructor<value_t::object>::construct(j, arr);
|
||||
}
|
||||
|
||||
template <typename BasicJsonType, typename T, std::size_t N,
|
||||
enable_if_t<not std::is_constructible<
|
||||
typename BasicJsonType::string_t, T (&)[N]>::value,
|
||||
int> = 0>
|
||||
void to_json(BasicJsonType &j, T (&arr)[N]) {
|
||||
external_constructor<value_t::array>::construct(j, arr);
|
||||
}
|
||||
|
||||
///////////////
|
||||
// from_json //
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue