From b82469154158041d4429430639416653f24c1789 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 19 Oct 2015 16:23:49 +1100 Subject: [PATCH] coord: add front/back methods --- coord/base.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/coord/base.hpp b/coord/base.hpp index c395ff39..db396fc0 100644 --- a/coord/base.hpp +++ b/coord/base.hpp @@ -60,6 +60,12 @@ namespace util { namespace coord { auto begin (void) { return std::begin (this->data); } auto end (void) { return std::end (this->data); } + const T& front (void) const { return this->data[0]; } + T& front (void) { return this->data[0]; } + + const T& back (void) const { return this->data[S-1]; } + T& back (void) { return this->data[S-1]; } + /////////////////////////////////////////////////////////////////////// // conversions template