Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-08-18 10:08:39


Rob Stewart <stewart_at_[hidden]> writes:

> You can omit spaces to make it look right to you. I dislike
> omitting spaces around operators. So, without the internal
> spaces, do you like any of them?
>
> if (any_of(...) <<some_predicate()>> 5)... // 1
>
> if (any_of(...) <some_predicate()> 5)... // 2
>
> if (any_of(...) ^some_predicate()^ 5)... // 3
>
> if (any_of(...) /some_predicate()/ 5)... // 4

Not with the parens in there. What's that for? Are you assuming
some_predicate is the type of a stateless function object?

   if (any_of(...) <<some_predicate>> 5)... // 1

   if (any_of(...) <some_predicate> 5)... // 2

   if (any_of(...) ^some_predicate^ 5)... // 3

   if (any_of(...) /some_predicate/ 5)... // 4

That's a little better. I guess any of them but the last looks okay.

Have you considered how/whether operator precedence will affect the
usability of these?

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