James Kanze
10/7/2008 11:43:00 AM
On Oct 7, 10:41 am, Christof Warlich <cwarl...@alcatel-lucent.de>
wrote:
> could anyone tell what's wrong with this?:
> template<int x>
> struct Outer {
> struct Inner {
> template<int y> void finner() {}
> };
> Inner inner;
> void fouter() {inner.finner<0>();}
The < here is a less than operator. I doubt that that's what
you wanted. You need to tell the compiler that inner.finner is
a template, e.g.:
inner. template finner< 0 >() ;
(In earlier compilers, this might work, because they don't
actually parse the template until instantiation. The standard
is designed, however, so that they can, and without knowing the
instantiation type, it can't know what inner.finner refers to.
In order to parse correctly, however, the compiler must know
which symbols name types, and which name templates. So you
occasionally have to insert typename or template to keep it
happy.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34