something confused

#include <iostream>
template <class T1, class T2>
void fun(T1&&, T2&&)
{
std::cout << typeid(T1).name() << " " << typeid(T2).name() << std::endl;
}
class A{};
void gun(A&&, int);
int main()
{
A a;
int i;
fun(a, i);//why does it have no compilation error?
//gun(a, i);//there is an error, it is normal
std::cin.get();
return 0;
}
Thanks!
BR!
Topic archived. No new replies allowed.