From: boost (boost_at_[hidden])
Date: 2002-04-17 16:48:17
On Wednesday 17 April 2002 21:23, Joerg Walter wrote:
> The precondition, that the sizes of the matrices shall be identical, is
> checked, because swap() is used in assign_temporary(). May be, we could
> move the precondition checks to assign_temporary().
If they are needed there, I'd move them.
> But swap() for matrix views like matrix_range<> is intended to have deep
> semantics similar to assignment, i.e. swap() should swap the elements of
> the referenced matrices, but not the views. Here the precondition seems to
> be reasonable.
Mmhh, why ? SInce the views are references to parts of a matrix,
I'd expect them to change after calling swap().
> So the interesting question arises, whether container and views should
> require the same precondition on swap() or container's swap() should be
> allowed to swap different sized matrices, too.
Container should be allowed to swap to different sized matrices, since
that's what we're used from STL.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk