mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 16:33:53 +01:00
ircd::json: Add tuple keys vector_view convenience conversion.
This commit is contained in:
parent
b65ff7ea53
commit
64170b6fef
1 changed files with 10 additions and 0 deletions
|
@ -34,6 +34,8 @@ struct ircd::json::keys
|
|||
|
||||
size_t count() const;
|
||||
|
||||
operator vector_view<const string_view>() const;
|
||||
|
||||
keys(const selection &);
|
||||
keys();
|
||||
};
|
||||
|
@ -153,6 +155,14 @@ ircd::json::keys<tuple>::keys(const selection &selection)
|
|||
selection.transform(this->begin(), this->end());
|
||||
}
|
||||
|
||||
template<class tuple>
|
||||
ircd::json::keys<tuple>::operator
|
||||
vector_view<const string_view>()
|
||||
const
|
||||
{
|
||||
return { this->data(), this->count() };
|
||||
}
|
||||
|
||||
template<class tuple>
|
||||
size_t
|
||||
ircd::json::keys<tuple>::count()
|
||||
|
|
Loading…
Reference in a new issue