
13 Feb
2003
13 Feb
'03
1:48 p.m.
A question on use of the matrix and vector classes: Should I: matrix<double> foo(const matrix<double> a) { matrix >double> r; ... return r; } or void foo(matrix<double>& r, const matrix<double> a) { ... } In other words: is it expensive to construct the temporary in case one? As I understand, the class would need an underlying 'copy on write' to be cheap, similar as strings do. I tried, to answer this question from the documentation, but sorry I did not get through. Thank you for help. Roland