Skip to content

Commit b67fd2e

Browse files
committed
document layout and max_size
1 parent 05bf8f7 commit b67fd2e

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

include/boost/multi/array.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,7 @@ struct
792792
return multi::move(ref_::operator[](idx));
793793
}
794794

795+
/// returns the maximum number of elements that the vector can hold.
795796
constexpr auto max_size() const noexcept { return static_cast<typename dynamic_array::size_type>(multi::allocator_traits<allocator_type>::max_size(this->alloc())); } // TODO(correaa) divide by nelements in under-dimensions?
796797

797798
protected:

include/boost/multi/array_ref.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,10 +1271,8 @@ class const_subarray : public array_types<T, D, ElementPtr, Layout> {
12711271
/// A type to hold the size of an array or subarray (size in the leading dimension) (usually signed)
12721272
using size_type = typename array_types<T, D, ElementPtr, Layout>::size_type;
12731273

1274-
// cppcheck-suppress duplInheritedMember ; TODO(correaa) eliminate array_types base
1275-
BOOST_MULTI_HD constexpr auto layout() const -> decltype(auto) { return array_types<T, D, ElementPtr, Layout>::layout(); }
1276-
1277-
// using basic_const_array [[decprecated]] = subarray<T, D, typename std::pointer_traits<ElementPtr>::template rebind<element_type const>, Layout>;
1274+
/// returns the internal layout information of the array
1275+
BOOST_MULTI_HD constexpr auto layout() const -> typename const_subarray::layout_type { return array_types<T, D, ElementPtr, Layout>::layout(); } // cppcheck-suppress duplInheritedMember ; TODO(correaa) eliminate array_types base
12781276

12791277
const_subarray() = default;
12801278
auto operator=(const_subarray const&) -> const_subarray& = delete;

0 commit comments

Comments
 (0)