Tell me how to call a function with parameters not defined in advance. That is, I have an array, for example, int arr [15], and I want to pass all the elements of the array as parameters. But the problem is that the array can be of any size. Functions have the form int a (int a, int b, int c ...), it is required to call them having this array. Of course, you can pass an array to a function and not do extra work, but you want to simplify writing functions and make normal parameters, rather than pulling values out of an array. The last time I solved this porblem is through assembler inserts of function parameters and its call. Perhaps there is a simpler method?
UPD. Still, I wonder why the compiler cannot be told that I want to call the void * test function, with a floating number of parameters, here are their number and here are the pointers to variables. Through the assembler it is done easily. Not much more dangerous than va_list.
std::vectorand do not bother. Assembly inserts - you were not mistaken for a millennium? - VladDva_listjust hides all the assembly inserts you would write inside yourself. This is probably quite convenient, otherwise you will have to write code designed for a specific compiler (take into account the order of the arguments, the method of their transmission and other low-level magic). Is it necessary? - gecube