Re: [eigen] matrix exponential with c++0x

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi

Quoting Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:

> Well, over here removing the 'typename' in front of _Function fixes
> the
> compilation for GCC.
> 
> typedef _Functor Functor;

Just a side note: avoid all names like _UnderscoreUppercase and
doubleunderscore__anywhere, they are reserved for the library
implementation. With something as generic as _Functor I see a real
danger of collision there (_Functor could be an arbitrarily mean macro...). 
(But I wouldn't recommend using _EigenAvoidNameClashFunctor either)
 
> You only need the typename when the type you want to redefine is a
> nested template type depending on the class's template parameters.
> Unfortunately, VC9 neither complains when the the typename keyword is 
> missing nor when it is given and not required - both cases are 
> treated as compilation errors by GCC.

And you can't force it to emit an error (by something equivalent to
-pedantic)?
Actually, the current standard's requirement of not using typename where
it's not needed is annoying. It can stop you from writing really generic
code. If you have a class template with a typedef in it that could
either alias a non-template class or another templated class dependent
on the same parameter as the outer template, then you actually have to
remember that choice everywhere you use the typedef, because in one case
you need to write "typename typedefname::inner i;", in the other
"typedefname::inner i;"
(Does anyone know if that is "fixed" in C++0x?)

Markus




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/