Utils

namespace tnt

Functions

template<std::incrementable T, typename U = T> requires std::equality_comparable_with< T, U > tnt::generator< T > range (T min_, U max_, decltype(std::declval< U >() - std::declval< T >()) step=decltype(std::declval< U >() - std::declval< T >()){1})

co_yield all the elements within the range [min_, max_) while walking with a certain step on python style.

Template Parameters
  • T: The type of min_.

  • U: The type of max_. Same as T by default.

Parameters
  • min_: The first element to co_yield.

  • max_: The element one past the range.

  • step: The number that will be added to min_ each call. Defaults to 1.