From 4ae58a4f466153c71db7f5d8150f609996b540eb Mon Sep 17 00:00:00 2001 From: Jason Volk <jason@zemos.net> Date: Fri, 27 Oct 2017 12:25:39 -0700 Subject: [PATCH] ircd::json: Add tuple construction from a different tuple object. --- include/ircd/json/tuple.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/ircd/json/tuple.h b/include/ircd/json/tuple.h index d4044d402..752be17ef 100644 --- a/include/ircd/json/tuple.h +++ b/include/ircd/json/tuple.h @@ -68,6 +68,7 @@ struct tuple static constexpr size_t size(); + template<class... U> tuple(const tuple<U...> &); tuple(const json::object &); tuple(const json::iov &); tuple(const std::initializer_list<member> &); @@ -796,6 +797,17 @@ tuple<T...>::tuple(const std::initializer_list<member> &members) }); } +template<class... T> +template<class... U> +tuple<T...>::tuple(const tuple<U...> &t) +{ + for_each(t, [this] + (const auto &key, const auto &val) + { + set(*this, key, val); + }); +} + template<class tuple, class it_a, class it_b,