Is it possible to use C++ variadic arguments to define a function that allows exactly the following calls:
f(int, char)
f(int, char, char)
f(int, char, char, int)
f(int, char, char, int, char)
...
Where every nth argument is a char if n is a prime number, and otherwise it is an int. The function can only be called in this way; it does not compile with other parameter patterns (e.g. f(2, 2) is an error, but f(2, '2') is ok).
f(int,char)can be called asf(2,2)without error and are seeking for a way to make it an error or is it sufficient to get the signature right? - 463035818_is_not_a_number