Bring a typename into scope from a templated base class

Brian Dessent brian@dessent.net
Fri Sep 26 02:32:00 GMT 2008


John Fine wrote:

> Is there a correct way to do what I want "using typename" to do?
> If I use the "typedef typename" instead of the "using typename", it
> makes this example work, but it doesn't quite mean the same thing.  I'll
> use that if there isn't a way to make "using typename" work.  But I'd
> like to first understand the problem.

I think what you want is:

template<class T>
struct B : A<T> {
typename A<T>::iterator it; };

See also:
<http://gcc.gnu.org/gcc-3.4/changes.html>
<http://kegel.com/gcc/gcc4.html>

Brian



More information about the Gcc-help mailing list