mirror of
https://github.com/matrix-construct/construct
synced 2024-12-29 08:54:02 +01:00
ircd::buffer: Add array operators.
This commit is contained in:
parent
9acdb31349
commit
ed59ef6e8e
1 changed files with 10 additions and 0 deletions
|
@ -109,6 +109,16 @@ struct ircd::buffer::buffer
|
|||
auto &end() const { return std::get<1>(*this); }
|
||||
auto &end() { return std::get<1>(*this); }
|
||||
|
||||
auto &operator[](const size_t &i) const
|
||||
{
|
||||
return *(begin() + i);
|
||||
}
|
||||
|
||||
auto &operator[](const size_t &i)
|
||||
{
|
||||
return *(begin() + i);
|
||||
}
|
||||
|
||||
buffer(const it &start, const it &stop)
|
||||
:std::tuple<it, it>{start, stop}
|
||||
{}
|
||||
|
|
Loading…
Reference in a new issue