From ed59ef6e8e6ae9be10b23da2014353d501d98cf5 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 22 Sep 2017 15:49:32 -0700 Subject: [PATCH] ircd::buffer: Add array operators. --- include/ircd/buffer.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/ircd/buffer.h b/include/ircd/buffer.h index 70cb68c67..0e4753a03 100644 --- a/include/ircd/buffer.h +++ b/include/ircd/buffer.h @@ -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{start, stop} {}