Skip to content

Instantly share code, notes, and snippets.

@thiagomg
Last active August 29, 2015 14:20
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 thiagomg/3599dd59ff6bd7632fd4 to your computer and use it in GitHub Desktop.
Save thiagomg/3599dd59ff6bd7632fd4 to your computer and use it in GitHub Desktop.
Do macro ao template
//Generico. Sem tipos declarados
#define FILL(v, i, start, end, step) { \
for(i=start; i < end; i+=step) \
v.push_back(i); \
}
#define ACCUM(v, ret) { \
for(size_t i=0; i < v.size(); i++) \
ret += v[i]; \
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment