From 625a2bcf6f2732a88939b4fe1336858f75f175a5 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 6 Jun 2019 17:02:39 -0700 Subject: [PATCH] ircd::vector_view: Add front() and back() convenience accessors. --- include/ircd/vector_view.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/ircd/vector_view.h b/include/ircd/vector_view.h index 91c28fdb2..1e57d50a5 100644 --- a/include/ircd/vector_view.h +++ b/include/ircd/vector_view.h @@ -59,6 +59,16 @@ struct ircd::vector_view return operator[](pos); } + value_type &back() const + { + return at(size() - 1); + } + + value_type &front() const + { + return at(0); + } + vector_view(value_type *const &start, value_type *const &stop) :_data{start} ,_stop{stop}