Skip to content

Commit dc17a59

Browse files
committed
document home
1 parent 9b8f476 commit dc17a59

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

include/boost/multi/array_ref.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,9 +1763,9 @@ struct const_subarray : array_types<T, D, ElementPtr, Layout> {
17631763
public:
17641764
template<typename Tuple> BOOST_MULTI_HD constexpr auto apply(Tuple const& tuple) const& -> decltype(auto) { return apply_impl_(tuple, std::make_index_sequence<std::tuple_size_v<Tuple>>{}); }
17651765

1766-
using iterator = detail::array_iterator<element, D, element_ptr, false, false, typename layout_type::stride_type, typename layout_type::sub_type>;
1767-
using const_iterator = detail::array_iterator<element, D, element_ptr, true, false, typename layout_type::stride_type, typename layout_type::sub_type>;
1768-
using move_iterator = detail::array_iterator<element, D, element_ptr, false, true, typename layout_type::stride_type, typename layout_type::sub_type>;
1766+
using iterator = detail::array_iterator<element, D, element_ptr, false, false, typename layout_type::stride_type, typename layout_type::sub_type>; ///< Random access iterator across the leading dimension (e.g. returned by `begin`/`end`)
1767+
using const_iterator = detail::array_iterator<element, D, element_ptr, true, false, typename layout_type::stride_type, typename layout_type::sub_type>; ///< Random access const-iterator across the leading dimension
1768+
using move_iterator = detail::array_iterator<element, D, element_ptr, false, true, typename layout_type::stride_type, typename layout_type::sub_type>; ///< Random access move-iterator across the leading dimension
17691769

17701770
const_subarray(const_iterator first, const_iterator last)
17711771
: const_subarray(layout_type(first->layout(), first.stride(), 0, (last - first) * first->size()), first.base()) {
@@ -1822,14 +1822,14 @@ struct const_subarray : array_types<T, D, ElementPtr, Layout> {
18221822
BOOST_MULTI_HD constexpr auto cbegin() const& { return begin(); } ///< returns an (explicitly const-)iterator to the beginning
18231823
BOOST_MULTI_HD constexpr auto cend() const& { return end(); } ///< returns an (explicitly const-)iterator to the end
18241824

1825-
using cursor = cursor_t<typename const_subarray::element_ptr, D, typename const_subarray::strides_type>;
1826-
using const_cursor = cursor_t<typename const_subarray::element_const_ptr, D, typename const_subarray::strides_type>;
1825+
using cursor = cursor_t<typename const_subarray::element_ptr, D, typename const_subarray::strides_type>; // Cursor for the array, the cursor is indexable, and it has pointer semantics (returned by `home`)
1826+
using const_cursor = cursor_t<typename const_subarray::element_const_ptr, D, typename const_subarray::strides_type>; // const-cursor for the array
18271827

18281828
private:
18291829
BOOST_MULTI_HD constexpr auto home_aux_() const { return cursor(this->base_, this->strides()); }
18301830

18311831
public:
1832-
BOOST_MULTI_HD constexpr auto home() const& -> const_cursor { return home_aux_(); }
1832+
BOOST_MULTI_HD constexpr auto home() const& -> const_cursor { return home_aux_(); } ///< Return a cursor pointing to the top corner element of the array, the cursor is indexed relative to this location
18331833

18341834
template<
18351835
class Range,

0 commit comments

Comments
 (0)