How can I write a function that accepts a variable number of arguments? Is this possible, how?
It is possible now...using boost any and templates In this case, arguments type can be mixed
#include
#include
#include
using boost::any_cast;
template
void Alert(T var1,Types... var2)
{
std::vector a( {var1,var2...});
for (int i = 0; i < a.size();i++)
{
if (a[i].type() == typeid(int))
{
std::cout << "int " << boost::any_cast (a[i]) << std::endl;
}
if (a[i].type() == typeid(double))
{
std::cout << "double " << boost::any_cast (a[i]) << std::endl;
}
if (a[i].type() == typeid(const char*))
{
std::cout << "char* " << boost::any_cast (a[i]) <