Shortcuts

Template Function ripple::unrolled_for_bounded

Function Documentation

template<size_t Amount, typename Functor, typename ...Args, unroll_enabled_t<Amount> = 0>
constexpr auto ripple::unrolled_for_bounded(Functor &&functor, Args&&... args) noexcept -> void

Applies the functor Amount times.

However, this is a bounded version and is safer than unrolled_for in that it will not unroll if the value of Amount is larger than the value defined by ripple_max_unroll_depth at compile time.

In the case that Amount is larger than ripple_max_unroll_length then a normal loop is performed and the functor is invoked on each iteration.

This overload is only enabled when

Amount < ripple_max_unroll_depth.
Note

This version will not always use a constexpr index, and therefore the index cannot be used in constexpr contexts.

However, this is a bounded version and is safer than

unrolled_for in that it will not unroll if the value of Amount is larger than the value defined by ripple_max_unroll_depth at compile time.
Parameters
  • functor: The functor to unroll.

  • args: The arguments to the functor.

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

  • Functor: The type of the functor.

  • Args: The type of the functor arguments.

In the case that Amount is larger than ripple_max_unroll_length then a normal loop is performed and the functor is invoked on each iteration.

This version will not always used a constexpr index, and therefore the index cannot be used in constexpr contexts.

This overload is only enabled when Amount >= ripple_max_unroll_depth.

Parameters
  • functor: The functor to unroll.

  • args: The arguments to the functor.

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

  • Functor: The type of the functor.

  • Args: The type of the functor arguments.

Docs

Access comprehensive developer documentation for Ripple

View Docs

Tutorials

Get tutorials to help with understand all features

View Tutorials

Examples

Find examples to help get started

View Examples