Skip to content

Commit 3abb74c

Browse files
authored
Merge pull request #2360 from JohanMabille/chunked_array
Fixed grid_shape return type
2 parents fc138f7 + a4dea70 commit 3abb74c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

include/xtensor/xchunked_array.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ namespace xt
5555

5656
using chunk_storage_type = chunk_storage;
5757
using chunk_type = typename chunk_storage::value_type;
58+
using grid_shape_type = typename chunk_storage::shape_type;
5859
using const_reference = typename chunk_type::const_reference;
5960
using reference = typename chunk_type::reference;
6061
using self_type = xchunked_array<chunk_storage>;
@@ -130,7 +131,7 @@ namespace xt
130131

131132
const shape_type& chunk_shape() const noexcept;
132133
size_type grid_size() const noexcept;
133-
const shape_type& grid_shape() const noexcept;
134+
const grid_shape_type& grid_shape() const noexcept;
134135

135136
chunk_storage_type& chunks();
136137
const chunk_storage_type& chunks() const;
@@ -470,7 +471,7 @@ namespace xt
470471
}
471472

472473
template <class CS>
473-
inline auto xchunked_array<CS>::grid_shape() const noexcept -> const shape_type&
474+
inline auto xchunked_array<CS>::grid_shape() const noexcept -> const grid_shape_type&
474475
{
475476
return m_chunks.shape();
476477
}
@@ -497,7 +498,8 @@ namespace xt
497498
template <class CS>
498499
inline auto xchunked_array<CS>::chunk_end() -> chunk_iterator_type
499500
{
500-
return chunk_iterator_type(*this, shape_type(grid_shape()), grid_size());
501+
shape_type sh = xtl::forward_sequence<shape_type, const grid_shape_type>(grid_shape());
502+
return chunk_iterator_type(*this, std::move(sh), grid_size());
501503
}
502504

503505
template <class CS>

0 commit comments

Comments
 (0)