Registered Member
|
I'm somewhat new to Eigen and trying to make a C++11 coherent noise library using Eigen, but I've hit a problem. I can't for the life of me figure out why the following code can't compile. I've followed the "Writing Functions Taking Eigen Types as Parameters" guide, but using the MatrixBase Parameter just makes it fail during compilation.
|
Moderator
|
This is because f<Eigen::Vector2f> will only accept objects deriving from: MatrixBase<Vector2f> while you are calling it with an object representing the addition of two vectors.
|
Moderator
|
I don't know what you are willing to achieve, but maybe one solution would be to use for f a true functor having a templated operator().
|
Registered Member
|
Got it working with a function object with a templated operator() like you suggested. Thanks.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]