M
ManicQin
Hi all.
Is there a way to iterate through a pre-defined list in pre-compile
time?
(not with for)
something like:
#define LIST int,double,float,string......
#define MAX 10
#define functionPattern(type) \
void return##type() { \
cout << #type << endl; \
}
//Replacing the next macro
#define functionCreator \
functionPattern(LIST[1]) \
functionPattern(LIST[2]) \
..
..
..
functionPattern(LIST[MAX])
Thanks
Is there a way to iterate through a pre-defined list in pre-compile
time?
(not with for)
something like:
#define LIST int,double,float,string......
#define MAX 10
#define functionPattern(type) \
void return##type() { \
cout << #type << endl; \
}
//Replacing the next macro
#define functionCreator \
functionPattern(LIST[1]) \
functionPattern(LIST[2]) \
..
..
..
functionPattern(LIST[MAX])
Thanks