J
Jean-Louis Leroy
Is the following code legal ?
template<typename T>
struct base
{
typedef T type;
};
template<typename T>
struct derived : base<T>
{
derived(type x);
};
g++ 3.3.4 and Visual Studio 2005 accept it. OTOH I don't see how they
recognize "type" as a type name. I would expect "typename
base<T>::type" to be required in "derived<T>".
Jean-Louis Leroy
template<typename T>
struct base
{
typedef T type;
};
template<typename T>
struct derived : base<T>
{
derived(type x);
};
g++ 3.3.4 and Visual Studio 2005 accept it. OTOH I don't see how they
recognize "type" as a type name. I would expect "typename
base<T>::type" to be required in "derived<T>".
Jean-Louis Leroy