Skip to content

internal::solve_retval, operator=, and new C++11 syntax

Submitted by François Legendre

Assigned to Nobody

Link to original bugzilla bug (#434)
Version: 3.1

Description

Thanks a lot for developping this fantastic library.

The reuse of "auto" keyword to deduce the type from an expression in the new C++ standard leads to code eg

auto a = X.jacobiSvd(ComputeThinU|ComputeThinV).solve(y) ;

and not

const VectorXd a = X.jacobiSvd(ComputeThinU|ComputeThinV).solve(y) ;

The newbie user (as me) gets then an error which is difficult to debug.

Can you forbid use of the operator= on internal::solve_retval when the latter is on the lhs ?

Thanks again,

François