Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2008-02-20 16:37:43


Am Mittwoch, 20. Februar 2008 17:50 schrieb Nico Galoppo:
> Hi,
>
> This somehow struck me by surprise... what is wrong with this code?
>
> Matrix K(ublas::identity_matrix<double>(n));

this defines a function pointer K to a function like:

Matrix foo( ublas::identity_matrix<double> n )

AFAIK the only workaround is to add extra parentheses:

// untested
Matrix K(( ublas::identity_matrix<double>(n) ));

(or to use operator=() instead of copy constructor)

mfg
Gunter