mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
ircd::json::tuple: Add selection copy constructor.
This commit is contained in:
parent
9e450cd912
commit
a6a740bbf6
1 changed files with 14 additions and 0 deletions
|
@ -64,6 +64,7 @@ struct tuple
|
|||
|
||||
template<class... U> explicit tuple(const tuple<U...> &);
|
||||
template<class U> explicit tuple(const json::object &, const json::keys<U> &);
|
||||
template<class U> explicit tuple(const tuple &, const json::keys<U> &);
|
||||
tuple(const json::object &);
|
||||
tuple(const json::iov &);
|
||||
tuple(const std::initializer_list<member> &);
|
||||
|
@ -208,6 +209,19 @@ tuple<T...>::tuple(const std::initializer_list<member> &members)
|
|||
});
|
||||
}
|
||||
|
||||
template<class... T>
|
||||
template<class U>
|
||||
tuple<T...>::tuple(const tuple &t,
|
||||
const keys<U> &keys)
|
||||
{
|
||||
for_each(t, [this, &keys]
|
||||
(const auto &key, const auto &val)
|
||||
{
|
||||
if(keys.has(key))
|
||||
set(*this, key, val);
|
||||
});
|
||||
}
|
||||
|
||||
template<class... T>
|
||||
template<class... U>
|
||||
tuple<T...>::tuple(const tuple<U...> &t)
|
||||
|
|
Loading…
Reference in a new issue