From e71d650d83170005a2aa2e97c24bee2b7109abf3 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 14 Sep 2017 13:19:39 -0700 Subject: [PATCH] ircd::buffer: Add member iterator concept. --- include/ircd/buffer.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/ircd/buffer.h b/include/ircd/buffer.h index 1ce24361f..5d1c647d0 100644 --- a/include/ircd/buffer.h +++ b/include/ircd/buffer.h @@ -95,6 +95,11 @@ struct ircd::buffer::buffer operator std::string_view() const; explicit operator std::string() const; + auto &begin() const { return std::get<0>(*this); } + auto &begin() { return std::get<0>(*this); } + auto &end() const { return std::get<1>(*this); } + auto &end() { return std::get<1>(*this); } + buffer(const it &start, const it &stop) :std::tuple{start, stop} {} @@ -120,7 +125,7 @@ struct ircd::buffer::const_buffer using buffer::buffer; const_buffer(const string_view &s) - :buffer{begin(s), end(s)} + :buffer{std::begin(s), std::end(s)} {} const_buffer() = default;