Given this snippet:
template <std::size_t Index, typename T, typename ...Args>
typename type_at<Index, T, Args...>::type
get(T t1, Args... args)
{
return
static_cast<type_at<Index, T, Args...>::type>
(
reinterpret_cast<void*>
(
value_at<Index, T, Args...>::get(t1, args...)
)
);
}
int main()
{
int * a = new int(10);
double* b = new double(3.14);
std::string c = "But I'm a string :(";
std::cout<< *get<0>(a, b, &c) <<"\n";
std::cout<< *get<1>(a, b, &c) <<"\n";
std::cout<< *get<2>(a, b, &c) <<"\n";
}
that doesn't work on GCC 4.8.1 but compiles and runs fine in VS2012 with the Nov CTP compiler ( didn't try clang by the way )
Which compiler is right?