adding front and back

This commit is contained in:
Jordan Maples [MSFT] committed 2020-01-09 12:03:27 -08:00
1 parent 0fefba89da
commit 4b823b1651
2 files changed
+29

No files matched your search

+13
View File
@@ -512,6 +512,19 @@ public:
constexpr reference at(index_type idx) const { return this->operator[](idx); }
constexpr reference operator()(index_type idx) const { return this->operator[](idx); }
constexpr reference front() const
{
Expects(size() > 0);
return data()[0];
}
constexpr reference back() const
{
Expects(size() > 0);
return data()[size() - 1];
}
constexpr pointer data() const noexcept { return storage_.data(); }
// [span.iter], span iterator support