Registered Member
|
Is there a way to write functions that can generically take non-const references to lvalues (MatrixBase<Derived>&) as well as references to rvalue blocks (i.e., MatrixBase<Derived>::RowXpr)?
I am working in c++0x and tried using &&, but I got an error about not being able to bind an lvalue to the rvalue reference... Might need to read up more on that. A simple test case:
|
Registered Member
|
Hi,
in C++ rvalues do not bind to mutable references. Changing your function to
works as expected. I have to admit, that I do not quite get why MatrixBase<Derived>&& did not work but it is at least a workaround. Regards, Hauke |
Registered Member
|
Cool, thank you for the workaround!
I've posted the code on GitHub: https://github.com/eacousineau/eigen_cpp0x [And I apologize for the lag-time in response!] |
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]