
6 Aug
2005
6 Aug
'05
11:03 a.m.
"David Abrahams" <dave@boost-consulting.com> wrote
"Andy Little" <andy@servocomm.freeserve.co.uk> writes:
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>()
Ok I see. Of course you can achieve this simply via one overloaded function. bool b1 = question<std::less>(all_of(a),any_of(b) ); bool b2 = question(frobnicates,all_of(a),any_of(b) ); The use of the dummy expression |frobnicates| is a poor substitute for a user defined operator. Should C++ incorporate a facility to define ones own operators? regards Andy Little