#include #include #include #include template void do_something(const Variant*, int); template void foo(const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4) { using namespace boost::mpl; typedef vector template_types; // using this instead works, but of course isn't what I want: // typedef vector template_types; typedef unique< template_types, boost::is_same<_1, _2> >::type unique_template_types; boost::make_variant_over< unique_template_types >::type args[4] = { arg1, arg2, arg3, arg4 }; do_something(args, 4); }