e.g.

int[] a = new int[la];
int[] b = new int[lb];
int[] c = new int[lc];
int[] d = new int[ld];


the func I want to write, e.g. for 2 arrays (instantiation) is like this:

void print_random_elem_addr(int[] x, int[] y) {
  auto i = random_int_between(0, x.length);
  auto j = random_int_between(0, y.length);
print(&(x[i], &(y[j])); // only single print() func call allowed!
}


But I want one generic function, which can be called as:

print_random_elem_addr(a, b);
print_random_elem_addr(a, b, c);
print_random_elem_addr(a, b, c, d);
...


My main question is how to meta-program (generate the parameter list) this line: print(&(x[i], &(y[j])); // only single print() func call allowed!


Thanks!

Reply via email to