Skip to content

Commit 6b3de66

Browse files
committed
make cursor private
1 parent 605e7d5 commit 6b3de66

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

include/boost/multi/array_ref.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,6 +1848,7 @@ struct const_subarray : array_types<T, D, ElementPtr, Layout> {
18481848
BOOST_MULTI_HD constexpr auto cbegin() const& { return begin(); } ///< returns an (explicitly const-)iterator to the beginning
18491849
BOOST_MULTI_HD constexpr auto cend() const& { return end(); } ///< returns an (explicitly const-)iterator to the end
18501850

1851+
private:
18511852
using cursor = cursor_t<typename const_subarray::element_ptr, D, typename const_subarray::strides_type>; ///< Cursor for access to the array, the cursor is indexable, and it has pointer semantics (returned by `home`)
18521853
using const_cursor = cursor_t<typename const_subarray::element_const_ptr, D, typename const_subarray::strides_type>; ///< Cursor for constant access to the array
18531854

@@ -3265,6 +3266,7 @@ struct const_subarray<T, 1, ElementPtr, Layout> // NOLINT(fuchsia-multiple-inhe
32653266
BOOST_MULTI_HD constexpr auto sliced(index first, index last) & -> const_subarray { return sliced_aux_(first, last); }
32663267
BOOST_MULTI_HD constexpr auto sliced(index first, index last) && -> const_subarray { return sliced_aux_(first, last); }
32673268

3269+
private:
32683270
using elements_iterator = elements_iterator_t<element_ptr, layout_type>;
32693271
using celements_iterator = elements_iterator_t<element_const_ptr, layout_type>;
32703272

test/cursor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ auto main() -> int { // NOLINT(readability-function-cognitive-complexity,bugpro
2626
}
2727
// BOOST_AUTO_TEST_CASE(iterator_2d)
2828
{
29-
static_assert(std::is_trivially_default_constructible_v<multi::array<double, 2>::cursor>);
30-
static_assert(std::is_trivially_copy_constructible_v<multi::array<double, 2>::cursor>);
31-
static_assert(std::is_trivially_copy_assignable_v<multi::array<double, 2>::cursor>);
29+
// static_assert(std::is_trivially_default_constructible_v<multi::array<double, 2>::cursor>);
30+
// static_assert(std::is_trivially_copy_constructible_v<multi::array<double, 2>::cursor>);
31+
// static_assert(std::is_trivially_copy_assignable_v<multi::array<double, 2>::cursor>);
3232

3333
// {
3434
// multi::array<double, 1> arr(multi::extensions_t<1>{multi::iextension{100}}, 99.0);

0 commit comments

Comments
 (0)