From: Pavel Chikulaev (pavel.chikulaev_at_[hidden])
Date: 2005-03-09 07:51:23
"Pavel Chikulaev" <pavel.chikulaev_at_[hidden]> wrote in message
>> It's nice when the cross product implementation can indicate by the
>> paramter type of its signature that it needs an intermediate result
>> (otherwise it would have to evalutate the expression explicitly or
>> direction * std::sin(a*half) will be evaluated twice).
> It won't be evaluated twice, AFAIK.
One more oops.
It will be in only one rare case:
//anything lazy-convertible to vector.
//will not be evaluated before calling xpd
But in most cases you should write:
xpd(const your_vector &);
//Lazy expression will be evaluated before
Also have lazy::evaluate( ) function to evaluate lazy-expression whenever
-- Pavel Chikulaev
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk