e.template test<1> ();template <int dim> void foo2() { Entity<dim> e;
// works like above e.other(); e.print("test");
// fails with syntax error e.test<1>();
e's type is dependent, so at parse time 'test' is presumed to be not a template and thus the '<' is a less than operator, rather than starting a template argument list.
nathan
-- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC The voices in my head said this was stupid too nathan@xxxxxxxxxxxxxxxx :: http://www.planetfall.pwp.blueyonder.co.uk