You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
broken from_json implementation for pair and tuple #707
I just realized that I introduced a bug in the develop branch.
The tests pass, because I forgot to add a test that retrieves a pair and a tuple...
That's really shameful, but luckily we haven't released yet.
// no need for variadic here by the waytemplate<typename BasicJsonType, typename... Args>
voidfrom_json(const BasicJsonType& j, std::pair<Args...>& p)
{
// broken, must use at().get<>()
p = {j.at(0), j.at(1)};
}
template<typename BasicJsonType, typename Tuple, std::size_t... Idx>
voidfrom_json_tuple_impl(const BasicJsonType& j, Tuple& t, index_sequence<Idx...>)
{
// same thing here
t = std::make_tuple(j.at(Idx)...);
}
Activity
nlohmann commentedon Aug 22, 2017
Can you open a PR?
theodelrieu commentedon Aug 22, 2017
Should not take really long, I'm on it.
fix from_json implementation for pair/tuple
fix from_json implementation for pair/tuple