
4 Nov
2006
4 Nov
'06
9:24 p.m.
I have a preprocessing task that exceeds my limited abilities. If any PP gurus want to step in and prevent me from hurting myself further, I would be very grateful. My problem is this: I want to mpl::and_ together a bunch of predicates. mpl::and_ has a limit of 4 arguments. So this is wrong: mpl::and_< pred1, pred2, pred3, pred4, pred5 > but this is ok: mpl::and_< pred1, pred2, pred3, mpl::and_< pred4, pred5 > > The challenge, should you choose to accept it, is to write some PP magic that, given a MAKE_PREDICATE(z, n, data) macro and a max arity (which is greater than 4!), generates a properly nested mpl::and_-ing of the predicates. Any takers? -- Eric Niebler Boost Consulting www.boost-consulting.com