#include <iostream>
#include <vector>

using namespace std;

enum types
{
    INT,
    DOUBLE,
    CHAR,
    STRING
};

struct multitype
{
    types type;

    union
    {
        int         i;
        double      d;
        char        c;
        const char *s;
    } val;

    multitype(int i)
        : type(INT)
    {
        val.i = i;
    }

    multitype(double d)
        : type(DOUBLE)
    {
        val.d = d;
    }

    multitype(char c)
        : type(CHAR)
    {
        val.c = c;
    }

    multitype(const char *s)
        : type(STRING)
    {
        val.s = s;
    }
};

struct helper
{
    vector<multitype> arr;

    template<typename T>
    helper& operator ,(T x)
    {
        arr.push_back(multitype(x));
        return *this;
    }
};

void print(const helper& h)
{
    for (int i = 0; i < h.arr.size(); i++)
    {
        const multitype& x = h.arr[i];

        switch (x.type)
        {
        case INT:
            cout << x.val.i << endl;
            break;
        case DOUBLE:
            cout << x.val.d << endl;
            break;
        case CHAR:
            cout << x.val.c << endl;
            break;
        case STRING:
            cout << x.val.s << endl;
            break;
        }
    }
}

#define PRINT(...) print((helper(), __VA_ARGS__))

int main()
{
    PRINT(2, 4.2, 'a', "Hello");
}