M
Marijn
I recently told g++ (3.2) something to the effect of:
template <class T>
struct test{
typedef int type;
};
template <class T>
void f(){
test<T>::type i;
}
To which g++ responded (in an unfriendly manner):
test.cpp: In function 'void f()':
test.cpp:11: warning: 'typename test<T>::type' is implicitly a
typename
test.cpp:11: warning: implicit typename is deprecated, please see the
documentation for details
Which confused me quite a lot. "test<T>::type" look explicit enough to
me... it only seems to happen when both the class and the function are
templates, and I can declare a test<T> allright, just not a
test<T>::type. Is this a language problem? I do not have any other
compilers so I do not know whether it could be a compiler thingy.
Suffice to say, it annoys me, I was trying to use a std::vector's
iterators in a templated container class that used an internal vector,
and it just would not allow it.
Marijn Haverbeke
template <class T>
struct test{
typedef int type;
};
template <class T>
void f(){
test<T>::type i;
}
To which g++ responded (in an unfriendly manner):
test.cpp: In function 'void f()':
test.cpp:11: warning: 'typename test<T>::type' is implicitly a
typename
test.cpp:11: warning: implicit typename is deprecated, please see the
documentation for details
Which confused me quite a lot. "test<T>::type" look explicit enough to
me... it only seems to happen when both the class and the function are
templates, and I can declare a test<T> allright, just not a
test<T>::type. Is this a language problem? I do not have any other
compilers so I do not know whether it could be a compiler thingy.
Suffice to say, it annoys me, I was trying to use a std::vector's
iterators in a templated container class that used an internal vector,
and it just would not allow it.
Marijn Haverbeke