varargs - Wrap a variable parameter function in C++ -


I would like to wrap xmlrpc "call" function (which takes a variable number of parameters) with another function of the parameters A variable number) I just want to extend the variable number of parameters passed in my wrapper function on xmlrpc "call" function I know how to use va_start and va_arg, but in fact I do not care about those values Those who have passed in, I just wrapped them up I want to move forward with the function. Is this possible?

I would like to wrap it for the function

  call (const char * url, const char * function, const char * paramspec, zero * result, ...) ;  

My cover takes care of the first three parameters and according to the reference result, it needs to forward the addition parameters to the call function

< P>

Unfortunately, there is no way to provide the correct forwarding of a function that is ... syntax. This is the reason that it is the best practice to implement all public variable logic function functions in a case of taking a va_list and providing both client interfaces with any client code. This is the reason that the standard library contains printf and vprintf , sprintf and vsprintf and so on.

If there is no vcall or none of this is not taking va_list then there is no easy way to do what you want to do. The only possibility is to explain the other arguments whether the variable given for your work based on the prescribed logic should be in the logic list, drag all the arguments from the variable logic into different variables and one of the numbers Make sure the code is based on the call , based on the extracted numbers and types. It is not possible to do this with full prevalence.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -