Skip to content

Instantly share code, notes, and snippets.

@akouryy
Created December 14, 2014 01:47
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 akouryy/15e8e386a6e4af740d34 to your computer and use it in GitHub Desktop.
Save akouryy/15e8e386a6e4af740d34 to your computer and use it in GitHub Desktop.
#define times(n, i) for(auto i = remove_reference<decltype( (n) )>::type(0); i < (n); i++)
#define upto(f, t, i) for(auto i = remove_reference<decltype((t)-(f))>::type(f); i <= (t); i++)
#define downto(f, t, i) for(auto i = remove_reference<decltype((t)-(f))>::type(f); i >= (t); i--)
#define uptil(f, t, i) for(auto i = remove_reference<decltype((t)-(f))>::type(f); i < (t); i++)
#define downtil(f, t, i) for(auto i = remove_reference<decltype((t)-(f))>::type(f); i > (t); i--)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment