Skip to content

Commit 18b50ba

Browse files
authored
Merge pull request #2520 from tdegeus/rank
Adding missing `rank` to `xtensor_adaptor`
2 parents d122fb3 + c1dc7fd commit 18b50ba

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

include/xtensor/xarray.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ namespace xt
230230
using backstrides_type = typename base_type::backstrides_type;
231231
using temporary_type = typename semantic_base::temporary_type;
232232
using expression_tag = Tag;
233+
constexpr static std::size_t rank = SIZE_MAX;
233234

234235
xarray_adaptor(storage_type&& storage);
235236
xarray_adaptor(const storage_type& storage);

include/xtensor/xtensor.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ namespace xt
225225
using backstrides_type = typename base_type::backstrides_type;
226226
using temporary_type = typename semantic_base::temporary_type;
227227
using expression_tag = Tag;
228+
constexpr static std::size_t rank = N;
228229

229230
xtensor_adaptor(storage_type&& storage);
230231
xtensor_adaptor(const storage_type& storage);

include/xtensor/xutils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ namespace xt
875875
template <class E>
876876
struct get_rank<E, decltype((void)E::rank, void())>
877877
{
878-
constexpr static std::size_t value= E::rank;
878+
constexpr static std::size_t value = E::rank;
879879
};
880880

881881
/******************

0 commit comments

Comments
 (0)