0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd::vector_view: Add front() and back() convenience accessors.

This commit is contained in:
Jason Volk 2019-06-06 17:02:39 -07:00
parent 36bd89098d
commit 625a2bcf6f

View file

@ -59,6 +59,16 @@ struct ircd::vector_view
return operator[](pos); 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) vector_view(value_type *const &start, value_type *const &stop)
:_data{start} :_data{start}
,_stop{stop} ,_stop{stop}