mirror of
https://github.com/matrix-construct/construct
synced 2024-10-05 07:08:53 +02: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;
|
size_t count() const;
|
||||||
|
|
||||||
|
operator vector_view<const string_view>() const;
|
||||||
|
|
||||||
keys(const selection &);
|
keys(const selection &);
|
||||||
keys();
|
keys();
|
||||||
};
|
};
|
||||||
|
@ -153,6 +155,14 @@ ircd::json::keys<tuple>::keys(const selection &selection)
|
||||||
selection.transform(this->begin(), this->end());
|
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>
|
template<class tuple>
|
||||||
size_t
|
size_t
|
||||||
ircd::json::keys<tuple>::count()
|
ircd::json::keys<tuple>::count()
|
||||||
|
|
Loading…
Reference in a new issue