![]() Registered Member ![]()
|
Hi,
I would like to create a class which takes fixed-size expressions as input to constructors. I tried using Eigen::Ref but the call is ambiguous. I am a bit confused: I thought each template instantiation introduces a new type. Is there any other way to achieve this? Here is some code that shows what I would like to do (Ideally without the commented-out constructors).
|
![]() Moderator ![]()
|
You have to exploit SFINAE with the enable_if mechanism to disambiguate between the different constructors, e.g.:
and of course feel free to use the more standard std::enable_if implementation if C++11 is ok for you, or also boost::enable_if if you already use boost. |
![]() Registered Member ![]()
|
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]