K
Kaba
Have a look at the following code:
template <typename T>
struct identity
{
typedef T type;
};
template <typename T>
void f(T t, typename identity<T>::type* p)
{
}
int main()
{
int a = 0;
f(a, 0);
return 0;
}
This compiles fine on Comeau C++, and Visual Studio 2008. However, GCC
4.4.5 gives an error:
"error: no matching function for call to ?f(int&, int)?"
Standard or not?
template <typename T>
struct identity
{
typedef T type;
};
template <typename T>
void f(T t, typename identity<T>::type* p)
{
}
int main()
{
int a = 0;
f(a, 0);
return 0;
}
This compiles fine on Comeau C++, and Visual Studio 2008. However, GCC
4.4.5 gives an error:
"error: no matching function for call to ?f(int&, int)?"
Standard or not?