#include <iostream>
#include <z/all.hpp>
int main() {
std::cout << "Generating even numbers until they're divisible by 20" << std::endl;
sentinel untilDivisibleBy20([](long value, long stepSize) -> bool { return value && value % 20 == 0; });
auto even = range(0, untilDivisibleBy20, 2);
for (auto i : even) {
std::cout << i << std::endl;
}
}
A sentinel that stops a numeric generator when the value reaches a certain point.
Definition sentinel.hpp:10
generator< long, long > range(long begin, long end, long step=1) noexcept
Generate a sequence of integers in a specified range.