#include <iostream>
#include <vector>
#include <typeinfo>
#include <boost/any.hpp>
std::vector<boost::any> myv;
myv.push_back((int)5);
myv.push_back((const char*)"my string");
// ..............
for(std::vector<boost::any>::iterator it = myv.begin(); it != myv.end(); ++it)
{
if(it->type() == typeid(int))
std::cout << "int: " << boost::any_cast<int>(*it) << std::endl;
else if(it->type() == typeid(const char*))
std::cout << "string: " << boost::any_cast<const char*>(*it) << std::endl;
}