Skip to content

Commit 793c5c1

Browse files
committed
refactor: restore explicit else blocks and migrate has_xslice to concepts
1 parent 549c090 commit 793c5c1

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

include/xtensor/views/xslice.hpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ namespace xt
122122
concept strided_compatible_concept = slice_or_scalar_concept<S> && !nonstrided_slice_concept<S>;
123123

124124
template <class... E>
125-
using has_xslice = std::disjunction<is_xslice<E>...>;
125+
struct has_xslice : std::bool_constant<(xslice_concept<E> || ...)>
126+
{
127+
};
126128

127129
/**************
128130
* slice tags *
@@ -821,7 +823,10 @@ namespace xt
821823
{
822824
return slice.size();
823825
}
824-
return 1;
826+
else
827+
{
828+
return 1;
829+
}
825830
}
826831

827832
/*******************************************************
@@ -835,7 +840,10 @@ namespace xt
835840
{
836841
return slice.step_size(idx);
837842
}
838-
return 0;
843+
else
844+
{
845+
return 0;
846+
}
839847
}
840848

841849
template <class S>
@@ -845,7 +853,10 @@ namespace xt
845853
{
846854
return slice.step_size(idx, n);
847855
}
848-
return 0;
856+
else
857+
{
858+
return 0;
859+
}
849860
}
850861

851862
/*********************************************

0 commit comments

Comments
 (0)