view: add front
and back
observers
This commit is contained in:
parent
80e9542328
commit
2a9be46d54
8
view.hpp
8
view.hpp
@ -242,6 +242,14 @@ namespace cruft {
|
|||||||
auto data (void) noexcept { return begin (); }
|
auto data (void) noexcept { return begin (); }
|
||||||
auto data (void) const noexcept { return begin (); }
|
auto data (void) const noexcept { return begin (); }
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------
|
||||||
|
auto& front (void) noexcept { return *m_begin; }
|
||||||
|
auto& front (void) const noexcept { return *m_begin; }
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------
|
||||||
|
auto& back (void) noexcept { return *(m_end - 1); }
|
||||||
|
auto& back (void) const noexcept { return *(m_end - 1); }
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
/// Returns true if the size of the view is zero.
|
/// Returns true if the size of the view is zero.
|
||||||
|
Loading…
Reference in New Issue
Block a user