Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2005-08-18 11:01:56


"Martin Bonner" <martin.bonner_at_[hidden]> wrote

> This is going to get messy as you say with templates (which would FORCE a
> space in).
>
>> if (any_of(...) ^some_predicate()^ 5)... // 3
>>
>> if (any_of(...) /some_predicate()/ 5)... // 4
> These two are visually too light-weight for my taste.
>
> Why not:
> if (any_of(...) *some_predicate()* 5)...
> or
> if (any_of(...) %some_predicate()% 5)...

IMO this argument boils down to whether C++ will be getting user-definable
operators ( IOW using a name as an operator).
If user-definable operators are not likely to become part of the languge, then
it seems to me to be unproductive to pursue the above, when a function call
syntax will work just as well.
Alternatively, if user-definable operators are likely to become part of C++,
then its most closely representable using a macro:

if ( any_of(...) BOOST_OPERATOR(some_predicate) 5 )...

For simplicity the precedence should be as high as possible( as close as
possible to function-call).

FWIW the argument on comp.std.c++ regarding user definable operators seems to
be mostly against.

regards
Andy Little


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk