Boost logo

Boost :

From: Gary Powell (Gary.Powell_at_[hidden])
Date: 2001-06-01 11:56:34


>>

but still:

    a, b | c

will be

   a, (b | c)

and not what we want:

   (a, b) | c

Gosh if you could make that work, I want that!

Joel de Guzman

<<

It's possible using expression templates. (but not easy.)
You build a tuple of

tuple< commaOperator, a, tuple<orOperator, b, c> >

as you evaluate the expression,

in the operator=(), you'd then parse the tuple.

but you'd have to parse the tuple for the commaOperator, and either build a
new tuple, or just evaluate it with some special case code.

tuple< orOperator, tuple<commaOperator, a, b>, c>;

Definitely ugly stuff. (And it may surprise experienced users because the
order of operations, is left to right, not in C/C++ priority.)

   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