|
Boost : |
From: Eric Niebler (eric_at_[hidden])
Date: 2008-03-17 18:55:07
Larry Evans wrote:
> Me too!
I couldn't tell from your email -- what are you me too-ing?
> In general, there should be an n-ary version of all the
> binary ops.
Do you mean, you'd like to create an expression expr<tag::plus,
args4<A,B,C,D> > ? There's nothing stopping you from doing that today.
make_expr<tag::plus>(1,2,3,4)
The only problem is that default_context won't know what to do with it,
but that's not big a problem ... just write your own context.
> This should also be extended to the or_ also.
> I remember having a problem with folding or_ because it was
> an n-ary op and had to define my own binary or which just
> forwarded to the or_. That was a "kludge". So maybe
> define or_ as binary and then define the n-ary version
> based on this binary.
IIRC, your problem was that or_ requires at least 2 parameters. I had
agreed to change that, but haven't yet.
-- Eric Niebler Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk