sfor: return cond

This commit is contained in:
Christian Zimmermann 2021-06-08 17:53:51 +02:00
parent c26fb133ae
commit f1b44cfd5c

View file

@ -7,7 +7,7 @@
namespace MultiArrayTools namespace MultiArrayTools
{ {
template <size_t BEG, size_t END, int OFF, typename Incr, typename F> template <size_t BEG, size_t END, int OFF, typename Incr, typename F>
inline void sfor(Incr incr, F f) inline auto sfor(Incr incr, F f)
{ {
constexpr auto idx = std::integral_constant<size_t, BEG>{}; constexpr auto idx = std::integral_constant<size_t, BEG>{};
constexpr auto idxm = std::integral_constant<size_t, BEG+OFF>{}; constexpr auto idxm = std::integral_constant<size_t, BEG+OFF>{};
@ -18,6 +18,7 @@ namespace MultiArrayTools
sfor<incr(idx),END,OFF>(incr,f); sfor<incr(idx),END,OFF>(incr,f);
} }
} }
return cond;
} }
template <size_t BEG, size_t END, int OFF, typename Incr, typename F, typename Cond> template <size_t BEG, size_t END, int OFF, typename Incr, typename F, typename Cond>