🔨 cleanup after #1134

This commit is contained in:
Niels Lohmann 2018-06-28 21:32:32 +02:00
parent 86a96b059d
commit 39dd775e38
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
2 changed files with 139 additions and 143 deletions

View file

@ -10,6 +10,7 @@
#include <nlohmann/detail/meta.hpp>
#include <nlohmann/detail/value_t.hpp>
#include <nlohmann/detail/iterators/iteration_proxy.hpp>
namespace nlohmann
{
@ -294,14 +295,12 @@ 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
// for https://github.com/nlohmann/json/pull/1134
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));
j = {{b.key(), b.value()}};
}
template<typename BasicJsonType, typename Tuple, std::size_t... Idx>