Facing Error while using variadic Function along with Macros

Revision en1, by vaibhavg_21, 2021-12-24 08:20:11

For reading a vector or any STL in C++ I was initialliy using a marco

#define read(x) for(auto &inps: x) cin>>inps
int n = 5;
vector<int> a(n),b(n),c(n);
read(a);
read(b);
read(c);

But for reading multiple vectors I want to implment a kind of function or macro that does something like

int n = 5;
vector<int> a(n),b(n),c(n);
read(a,b,c);

Can someone help me that how to implement this? I have tried to implement this using templates and macros but i am facing error. Here I have attached the code that I had implemented.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English vaibhavg_21 2021-12-24 08:20:51 185
en1 English vaibhavg_21 2021-12-24 08:20:11 642 Initial revision (published)