I try to get every value of arguments in Macro, as follow
#include <iostream>
#include <stdio.h>
#include <tuple>
using namespace std;
class T {
public:
string a;
string b;
};
#define CONFIG_FUNCTION(...) int SetValue(T t){\
int arg_len = tuple_size<decltype(make_tuple(__VA_ARGS__))>::value;\
auto t = make_tuple(__VA_ARGS__);\
int i = 0;\
cout << arg_len << endl;\
while (i < arg_len) {\
// I need to get every value of __VA_ARGS__
// t.a = "assigntment"
}\
cout << get<1>(t) << endl;\
}
CONFIG_FUNCTION("a", "b", "c", "d", "e");
int main()
{
T t;
SetValue(t);
return 0;
}
The number of arguments ("a", "b", "c", "d", "e") are variable, how can I traverse the value.