Boost logo

Boost :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2002-07-15 09:28:37


On Monday 15 July 2002 16:07, David Abrahams wrote:
> From: "Toon Knapen" <toon.knapen_at_[hidden]>
> > Feel free to suggest some other/more syntax simplifications ?
>
> I wish I could. I really wish we could use colon notation in C++.
> I don't think we have enough operators available to make this any prettier.

Indeed, it's a pitty.

>
> > > Why is an .assign() member function being used instead of operator= ?
> > > I thought uBlas had expression templates!?
> >
> > AFAIK, the assign assumes that there's no aliasing between lhs and rhs.
> > Otherwise the rhs will first be stored in a temporary.
>
> Ah, thanks.
>
> One idea to consider:
>
> x.assign() = blah blah blah
>
> would at least set the LHS off from the rhs a little better.

Or add some policy to the matrices and vectors to indicate if they are
aliased. e.g. 'matrix< double, column_major, restrict > a(10,10);'
Or better yet, just rely on 'restrict' but I'm not sure how that can be
detected inside the et mechanism.

t


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk