Registered Member
|
I tried the following. I want to change a reference of MatrixBase in a function...
Output: 10 4 4 4 4 4 4 10 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 Whih works! Why should I use the following (const_cast) as suggested in the documentation http://eigen.tuxfamily.org/dox/TopicFunctionTakingEigenTypes.html#TopicPlainFunctionsFailingto use:
Its not needed to change a reference... ?? I dont understand... Thanks for your help!! |
Registered Member
|
Only MSVC allows to assign rvalues to non-const reference, silently, without noting!....
Thats why it worked, so in general use CONST! |
Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar