#include <iostream>
#include <string>

template<typename A1, typename A2>
struct printer
{
    void print(A1 const& a1, A2 const& a2)
    {
       std::cout << a1 << " " << a2 << "\n";
    }

    void print(void** args)
    {
        print(*static_cast<A1*>(args[0]), *static_cast<A2*>(args[1]));
    }
};

int main()
{
    printer<std::string, int> my_printer;
    my_printer.print("Test", 1);

    std::string a1 = "Test";
    int a2 = 2;
    void* args[] = { &a1, &a2 };
    my_printer.print(args);
}