13 Feb
2003
13 Feb
'03
3:58 p.m.
On Thursday 13 February 2003 14:48, "speedsnaii wrote:
A question on use of the matrix and vector classes: 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.
matrices and vectors (the containers themselves) have deep copy semantics. Views (like matrix_range, matrix_stride, matrix_row etc) have shallow copy semantics. So if you want to pass a matrix by value (syntacticly) but want shallow copy semantics, just define a matrix_range on your matrix that covers the whole matrix and use this in the argument list. toon