0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-02-18 09:40:12 +01:00

ircd::buffer: Add member iterator concept.

This commit is contained in:
Jason Volk 2017-09-14 13:19:39 -07:00
parent 296fd9183b
commit e71d650d83

View file

@ -95,6 +95,11 @@ struct ircd::buffer::buffer
operator std::string_view() const; operator std::string_view() const;
explicit operator std::string() 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) buffer(const it &start, const it &stop)
:std::tuple<it, it>{start, stop} :std::tuple<it, it>{start, stop}
{} {}
@ -120,7 +125,7 @@ struct ircd::buffer::const_buffer
using buffer<const char *>::buffer; using buffer<const char *>::buffer;
const_buffer(const string_view &s) const_buffer(const string_view &s)
:buffer<const char *>{begin(s), end(s)} :buffer<const char *>{std::begin(s), std::end(s)}
{} {}
const_buffer() = default; const_buffer() = default;