From 5d3ce83f522a73da4ffa6b32dcb0c2ee9b1aa944 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 8 Feb 2019 18:22:40 -0800 Subject: [PATCH] ircd::buffer: Allow decay-like conversion to begin pointer. --- include/ircd/buffer/buffer_base.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/ircd/buffer/buffer_base.h b/include/ircd/buffer/buffer_base.h index 81a7cfa18..0160c738d 100644 --- a/include/ircd/buffer/buffer_base.h +++ b/include/ircd/buffer/buffer_base.h @@ -20,6 +20,7 @@ struct ircd::buffer::buffer using iterator = it; using value_type = typename std::remove_pointer::type; + explicit operator const it &() const; operator string_view() const; explicit operator std::string_view() const; explicit operator std::string() const; @@ -92,3 +93,11 @@ const { return { reinterpret_cast(data(*this)), size(*this) }; } + +template +ircd::buffer::buffer::operator +const it &() +const +{ + return begin(); +}