|
Boost : |
From: joel de guzman (isis-tech_at_[hidden])
Date: 2001-06-01 19:21:07
[snip comma ops]
>
> 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.)
>
As I mentioned in my other post, how do you distinguish explicit grouping?:
a, (b | c).... explicit grouping
a, b | c.... implicit grouping (precedence groups (b | c) automatically)
Cheers,
Joel de Guzman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk