Boost logo

Boost :

From: Gary Powell (Gary.Powell_at_[hidden])
Date: 2001-05-23 16:14:32


> Perhaps not in a first release of the threads library, but one could use
> expression templates to make "i = (i+2)/2" safe. Delay evaluation until an
>
> assignment operation is reached. On assignment it acquires a lock,
> performs
> the evaluation and assignment, and then releases the lock.
>
Yet another cool application of Expression Templates!

It wouldn't solve the
  i = (i +2)/2;
  j = (j +3)/3;

But for what Beman wanted it would work quite well.

  Yours,
 -gary-

gary.powell_at_[hidden]


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