#ifndef CK_FUNCTIONAL2_HPP #define CK_FUNCTIONAL2_HPP #include "functional.hpp" #include "Sequence.hpp" namespace ck { namespace detail { template struct static_for_impl; template struct static_for_impl> { template __host__ __device__ constexpr void operator()(F f) const { swallow{(f(Number{}), 0)...}; } }; } // namespace detail // F signature: F(Number) template struct static_for { __host__ __device__ constexpr static_for() { static_assert(NBegin <= NEnd, "wrongs! should have NBegin <= NEnd"); static_assert((NEnd - NBegin) % Increment == 0, "Wrong! should satisfy (NEnd - NBegin) % Increment == 0"); } template __host__ __device__ constexpr void operator()(F f) const { detail::static_for_impl::type>{}( f); } }; } // namespace ck #endif