0
0
Fork 0
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:
Jason Volk 2019-01-16 18:35:30 -08:00
parent 9e450cd912
commit a6a740bbf6

View file

@ -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)