Template Struct Unroll

Struct Documentation

template<size_t Amount>
struct wrench::detail::Unroll

The Unroll struct invokes a callable object N times, where the invokations are unrolled at compile time.

This struct is an implementation detail for unrolled_for.

Template Parameters
  • Amount: The amount of unrolling to do.

Public Types

using PreviousLevel = Unroll<previous_level>

Defines the type of the case class which invokes at the previous level.

Public Functions

template<typename Functor, typename ...Args>
constexpr Unroll(Functor &&functor, Args&&... args) noexcept

Passes the functor and args to the previous level to invoke, and then invokes at this level.

Parameters
  • functor: The functor to invoke.

  • args: The arguments to pass to the functor.

Template Parameters
  • Functor: The type of the functor to invoke.

  • Args: The type of the arguments to invoke with.

Public Static Attributes

constexpr size_t previous_level = (Amount <= 1 ? 0 : Amount - 1)

Defines the value for the previous level.