Registered Member
|
I know Copy Elision can deal with return type.
However, I have a type derived from VectorXd, let's say MyVector. Is it possible to move one to another? For examle,
And sometimes it is reasonable to move a MatrixXd with 1 column to VectorXd (here MyVector). Even more general case is converting a return matrix into a column vector. |
Moderator
|
In Eigen 3.3 (beta-1 or devel branch), move semantic is supported for exact same types. Generalizing to compatible sizes and storage layout would be easy (patch welcome, see src/Core/Matrix.h line 272), but for reshaping, we would first need a proper API for that.
|
Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient