Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-08-05 16:07:36


"Andy Little" <andy_at_[hidden]> writes:

> "David Abrahams" <dave_at_[hidden]> wrote
>> Rob Stewart <stewart_at_[hidden]> writes:
>
>>>> all_of(a)._(frobnicates, any_of(b))
>>>>
>>>> all_of(a)._,frobnicates, any_of(b)
>>>>
>>>> all_of(a)._ %frobnicates% any_of(b)
>>>>
>>>> all_of(a)._ |frobnicates| any_of(b)
>>>>
>>>> all_of(a)._ <frobnicates> any_of(b)
>
>>> all_of(a)(frobnicates, any_of(b))
>
> Yuck and Yuck FWIW. AFAIK only prefix user defined operations work in C++.
>
> if ( frobnicates(all_of(a), any_of(b))) {

You can't do that unless you ask people to put smarts about all_of and
any_of inside of frobnicates. The goal is to use a general predicate
such as std::less<int>()

> frazzle(a);
> }else{
> frazzle(b);
> }
>
> At least until user defined operators are allowed:
>
> frazzle a if all_of a frobnicates any_of b
> else frazzle b;
>
> But till then keep it simple please !

No can do, boss.

-- 
Dave Abrahams
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