Skip to content

Commit bfc9319

Browse files
committed
document front
1 parent 23d7325 commit bfc9319

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

include/boost/multi/array_ref.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,8 @@ struct const_subarray : array_types<T, D, ElementPtr, Layout> {
14041404
// return operator[](detail::head(tup));
14051405
// }
14061406

1407+
/// Returns a const reference to the first element.
1408+
/// \pre `!is_empty()`
14071409
constexpr auto front() const& -> const_reference { return *begin(); }
14081410
constexpr auto back() const& -> const_reference { return *(end() - 1); } // std::prev(end(), 1);}
14091411

@@ -3112,6 +3114,8 @@ struct const_subarray<T, 1, ElementPtr, Layout> // NOLINT(fuchsia-multiple-inhe
31123114

31133115
BOOST_MULTI_HD constexpr auto operator[](index idx) const& -> typename const_subarray::const_reference { return at_aux_(idx); } // NOLINT(readability-const-return-type) fancy pointers can deref into const values to avoid assignment
31143116

3117+
/// Returns a const reference to the first element.
3118+
/// \pre `!is_empty()`
31153119
BOOST_MULTI_HD constexpr auto front() const& -> const_reference { return *begin(); }
31163120
BOOST_MULTI_HD constexpr auto back() const& -> const_reference { return *std::prev(end(), 1); }
31173121

@@ -3426,7 +3430,7 @@ struct const_subarray<T, 1, ElementPtr, Layout> // NOLINT(fuchsia-multiple-inhe
34263430

34273431
public:
34283432
BOOST_MULTI_HD constexpr auto begin() const& -> const_iterator { return begin_aux_(); } ///< returns a iterator to the beginning
3429-
BOOST_MULTI_HD constexpr auto end() const& -> const_iterator { return end_aux_(); } ///< returns a iterator to the end
3433+
BOOST_MULTI_HD constexpr auto end() const& -> const_iterator { return end_aux_(); } ///< returns a iterator to the end
34303434

34313435
#if defined(__GNUC__) && !defined(__EDG__)
34323436
#pragma GCC diagnostic push

0 commit comments

Comments
 (0)