Skip to content

Instantly share code, notes, and snippets.

@fabiogaluppo
Created November 5, 2015 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiogaluppo/39d3a8ca29487d4ca4a3 to your computer and use it in GitHub Desktop.
Save fabiogaluppo/39d3a8ca29487d4ca4a3 to your computer and use it in GitHub Desktop.
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