Add restriction for tuple specialization of to_json
This commit fix the issue #1825 Signed-off-by: Camille Bégué <c.begue@samsung.com>
This commit is contained in:
parent
3790bd9ae0
commit
8b686b30eb
4 changed files with 38 additions and 6 deletions
|
|
@ -322,10 +322,10 @@ void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequence<Idx...>
|
|||
j = { std::get<Idx>(t)... };
|
||||
}
|
||||
|
||||
template<typename BasicJsonType, typename... Args>
|
||||
void to_json(BasicJsonType& j, const std::tuple<Args...>& t)
|
||||
template<typename BasicJsonType, typename T, enable_if_t<is_constructible_tuple<BasicJsonType, T>::value, int > = 0>
|
||||
void to_json(BasicJsonType& j, const T& t)
|
||||
{
|
||||
to_json_tuple_impl(j, t, index_sequence_for<Args...> {});
|
||||
to_json_tuple_impl(j, t, make_index_sequence<std::tuple_size<T>::value> {});
|
||||
}
|
||||
|
||||
struct to_json_fn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue