|
Boost : |
From: Serge Barral (sbarral_at_[hidden])
Date: 2001-03-27 06:41:37
On Mon, 26 Mar 2001 20:59:32 Jeremy Siek wrote:
> On Mon, 26 Mar 2001, Serge Barral wrote:
[...]
> sbarra> On an other topic, I'd be interested to know if the
> sbarra> consensus is towards making an expression template
> sbarra> implementation of multidim arrays. I personnaly believe
> sbarra> that dropping ET on the base of portability considerations
> sbarra> would be unfortunate in the long run.
>
> I was thinking that we'd make the expression template stuff an optional
> add-on. That way we keep the portability for the core array stuff. In
> terms of release schedule, I was thinking the core array stuff would be
> released first without the ET, and then a later release would include the
> ET stuff.
The problem is that thinks like:
A[ 1 <= r <= 3 ] = A[ 0 <= r <= 2 ];
are dangerous if the ET implementation doesn't make temporaries before
assignement (which is desirable in general), so that there might not be
compatibility between both implementations.
The Expresso library solves this problem by providing an operator <<= for
temporary-less assignement, while = evaluates the whole array on the RHS
before assignement (if I understood well).
Serge
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk