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

[ Thread Index | Date Index | More Archives ]

2009/12/3 Björn Piltz <bjornpiltz@xxxxxxxxxxxxxx>
The problem was that the template parameter named "Functor" clashed
with the class named "Functor". That is why I renamed the template
parameter. I only used the typedef to keep the lines changed to a
minimum. An alternative would be to rename the class.

I thought prepending "_" to template parameters was an Eigen standard
precisely to avoid name clashes when the names are very generic, like
_Scalar, _Rows, _Cols and _Options in class Matrix.

Anyhow, I'm sorry I broke compilation with GNU, I didn't bother
recompiling since the change was so trivial. I'll look into it.

> Uh, and I know that Visual Studio accepts this without complaining - this is why I never really seem to learn it.
Sorry, I didn't quite get that.

Well, over here removing the 'typename' in front of _Function fixes the compilation for GCC.

typedef _Functor Functor;

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.

- Hauke

Mail converted by MHonArc 2.6.19+