mirror of
https://github.com/matrix-construct/construct
synced 2025-01-17 01:51:53 +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() const { return std::get<1>(*this); }
|
||||||
auto &end() { 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)
|
buffer(const it &start, const it &stop)
|
||||||
:std::tuple<it, it>{start, stop}
|
:std::tuple<it, it>{start, stop}
|
||||||
{}
|
{}
|
||||||
|
|
Loading…
Add table
Reference in a new issue