Boost logo

Boost Users :

From: dizzy (dizzy_at_[hidden])
Date: 2008-02-15 11:40:03


Hello

On Friday 15 February 2008 18:24:26 Michael Fawcett wrote:
> Are you saying that short-circuit evaluation doesn't happen here, i.e.
> the second(t) call happens no matter what?

At the time of safe_and or safe_or construction both expressions are evaluated
and I didn't thought of it more (like using bind and such in your code).

> emp_container::const_iterator e = find_if(staff.begin(), staff.end(),
> safe_logical_and(safe_logical_or(bind(&employee::name, _1) ==
> "Paula", bind(&employee::name, _1) == "John"),

With this kind of usage it is probably fine as bind (and the lambda operator==
which I assume it is used in that expression) delays the actual evaluation of
the expression (ie of "name" member being equal to some value) until later
when you invoke it in your or_/and_ functors. Thanks for taking your time to
explain this, I did not understood it from your previous email.

-- 
Mihai RUSU					Email: dizzy_at_[hidden]
			"Linux is obsolete" -- AST

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net