Instantly share code, notes, and snippets.

Embed
What would you like to do?
template<typename T> struct iota_step final
{
explicit iota_step(T init, const T increment)
: next(init), step(increment) {}
iota_step& operator++()
{
next += step;
return *this;
}
operator T() const { return next; }
private:
T next;
const T step;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment