mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
ircd::json: Add tuple construction from a different tuple object.
This commit is contained in:
parent
2ce9b0521f
commit
4ae58a4f46
1 changed files with 12 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue