Registered Member
|
Hello everyone.
I try to use the fixed-size block expression a.leftCols<1>() inside a function template (see Example 2) and it does not compile if I do not try to instantiate the template. If I do try to instantiate it, it throws a template error from hell (remove the comment in example2() to test it!). You can see both errors below. In the documentation it says that the fixed-size block expression is equivalent to the dynamic-size block expression a.leftCols(1). However this one does work in example1 (as I think it is supposed to do). Both work if I use them in main (see code), so i guess this has to be somehow related to the fact that I am using them inside a function template. I have been fighting with this for a while already, am I doing something wrong? I am using gcc-4.7 and Eigen 3.1.1. The error when I do not try to instantiate it: 18:81: error: expected primary-expression before ‘)’ token The template error from hell when I do try to instantiate it:
|
Registered Member
|
This is a fairly obscure C++ issue. You need to add the template keyword:
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot]