1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-29 23:01:16 +03:00

fixed compile error for #1045; to_json for iternation_proxy_internal was needed

This commit is contained in:
Danielc
2018-06-16 12:01:49 +03:00
parent 8d8f890771
commit 1566ad4053
3 changed files with 29 additions and 5 deletions

View File

@ -284,6 +284,16 @@ void to_json(BasicJsonType& j, const std::pair<Args...>& p)
j = {p.first, p.second};
}
template<typename IteratorType> class iteration_proxy; // TODO: Forward decl needed, maybe move somewhere else
template<typename BasicJsonType, typename T,
enable_if_t<std::is_same<T, typename iteration_proxy<typename BasicJsonType::iterator>::iteration_proxy_internal>::value, int> = 0>
void to_json(BasicJsonType& j, T b) noexcept
{
typename BasicJsonType::object_t tmp_obj;
tmp_obj[b.key()] = b.value(); // TODO: maybe there is a better way?
external_constructor<value_t::object>::construct(j, std::move(tmp_obj));
}
template<typename BasicJsonType, typename Tuple, std::size_t... Idx>
void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequence<Idx...>)
{