dsharlet / array

C++ multidimensional arrays in the spirit of the STL
Apache License 2.0
198 stars 15 forks source link

Add dim(size_t d) overload to class array #75

Closed fbleibel-g closed 2 years ago

fbleibel-g commented 2 years ago

This mirrors the templated accessor added on array:

template <size_t D, class = enable_if_dim const auto& dim()

Both accessors still forward calls to the underlying shape_.

fbleibel-g commented 2 years ago

This has bothered me for a while but I didn't get to add it until now. This is the mirror of the existing function on shape{}

Do you think we should add a test? I didn't find a test for the existing shape function in shape.cpp.