help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Correct use of templated class'es inner structs/classes?


From: Michiel Salters
Subject: Re: Correct use of templated class'es inner structs/classes?
Date: 7 May 2004 07:04:30 -0700

Tomas Ukkonen <tomas.ukkonen@iki.fi> wrote in message 
news:<pan.2004.05.07.09.54.54.797578@iki.fi>...
> Hi

> Code very close to a example below fails to compile
> because gcc 3.4.0 complains:
> "error:   expected a type got 'Y<T>::particle'"
> at Y<T>::func()'s iterator declaration.

Indeed. Without knowing T, gcc cannot tell whether particle is
a member type, a data member, a member function, or a member template. 

The solution is (obviously) to tell the compiler: 

std::vector<typename Y<T>::particle> list;

Regards,
Michiel Salters


reply via email to

[Prev in Thread] Current Thread [Next in Thread]