I'm writing several functions which takes as input the result of a template function:
int alg1(Vect3) {...}
...
int algN(Vect3) {...}
void main() {
alg1( mat.topRightCorner<3,1>() )
}
where, if you are curious, topRightCorner returns a submatrix of mat, a method from the Eigen, where the dimension are placed as template parameters when are known at compile time.
However creating a "shortcut" using a macro to quickly switch between different algorithms (since in the real code the function is called many times), like this
#define ALG(X) ( algN(X) )
ALG( mat.topRightCorner<3,1>() )
gives an error, since the macro is correctly expanded but is somehow misinterpreted as with two different parameters, mat.topRightCorner<3 and 1>().
Wrapping the input with brackets will do the trick, but why this behaviour?
(since in the real code the function is called many times)- Lightness Races in Orbit