Boost logo

Boost Users :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-03-16 00:12:28


On Fri, 15 Mar 2002, Jon Kalb wrote:
kalb> > struct A
kalb> > {
kalb> > typedef
kalb> > filter_iterator_generator<is_active,vector<int>::iterator>::type
kalb> > active_iterator;
kalb>
kalb>
kalb> CodeWarrior doesn't complain about this code, but I think that it should be:
kalb>
kalb> typedef typename
kalb> filter_iterator_generator<is_active,vector<int>::iterator>::type
kalb> active_iterator;

"typename" is required when the type of the left-hand side of the "::" is
somehow dependent on a template parameter, which is not the case in the
above code.

Also, "typename" is not allowed when the left-hand side is not dependent
on a template paraemter, so adding "typename" to the above code results
in an illegal program.

Cheers,
Jeremy

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net