Skip to content

Instantly share code, notes, and snippets.

@apathyboy
Created June 7, 2015 16:10
Show Gist options
  • Save apathyboy/18fc684156bd1323f140 to your computer and use it in GitHub Desktop.
Save apathyboy/18fc684156bd1323f140 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <vector>
#define Y(x) v.push_back(x);
#define REPEAT10(x) REPEAT9(x); x
#define REPEAT9(x) REPEAT8(x); x
#define REPEAT8(x) REPEAT7(x); x
#define REPEAT7(x) REPEAT6(x); x
#define REPEAT6(x) REPEAT5(x); x
#define REPEAT5(x) REPEAT4(x); x
#define REPEAT4(x) REPEAT3(x); x
#define REPEAT3(x) REPEAT2(x); x
#define REPEAT2(x) REPEAT1(x); x
#define REPEAT1(x) x
#define REPEAT0(x)
#define REPEAT(n, t) REPEAT ## n(t)
int main()
{
std::vector<int> v;
REPEAT10(REPEAT(10, REPEAT(10, Y(1))));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment