I'll have a look at boost::any although I was hoping it was possible within the standard library.

The reason I need this is that i'm building an xmlrpc client to communicate with a server. I want a dynamic function that can handle all types which may be sent over the xmlrpc protocol (int, bool, string & array). It must also be able to accept any number of arguments (as different calls require different numbers of arguments). If I was using php or python I would simply pass an array or list of all the arguments to the send function and iterate over them.

There is probably something in c++ which would allow me to do this, preferably within the standard library. However i'm new to c++ and unaware of most of its features.