Skip to content
Archive of entries posted on April 2010

Calling function via void* pointer with arguments contained in std::container in a C++03 way

Recently I posted a technique that can be used to call functions, passed as raw void* pointers with arguments contained in an std::vector, so that the arguments are correctly transformed from container to normal C/C++–style arguments list. The method proposed was quite generalized and pretty type–safe. But it had one limitation: it required C++0x compiler [...]

Calling function via void* pointer with arguments contained in std::container

Today I passed by a question posted to accu-general mailing list of Accu organization, which raised my interest. The guy was asking if it is possible to call a function, previously casted to void* pointer, passing to it a number of homogeneous arguments, with their unknown exact quantity at compile–time, that are contained in a [...]