Boost logo

Boost :

Subject: Re: [boost] [proto] transforms && rvalue refs
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2009-03-30 13:27:57

troy d. straszheim a écrit :
> When it is time to evaluate the expression, the grammar fires the
> transform for exp(B) first. It creates a temporary T with the same
> dimensions as B and and a function is called to compute the result
> into T. Now 'T * C' happens. In this case there is an available
> temporary, 'T', so the result can go right in to T. T is returned and
> moved in to A. Done... at least, that's the idea.
No, when you evaluate the expression, you iterate via a for loop nest
over the elements of all array, recursively calling the elementwise
version of exp and *. The context just evaluate one element at a time.
In the end, the only temporary created are those from the elementwise
function return.

Expression Tempalte never create copy of their terminal object unless

Joel Falcou - Assistant Professor
PARALL Team - LRI - Universite Paris Sud XI
Tel : (+33)1 69 15 66 35

Boost list run by bdawes at, gregod at, cpdaniel at, john at