Nat Goodspeed
Archie14 wrote:
What I am trying to achieve is to stop for_each if "getParamValue" returns false. However I can't find a way to use "return" in the second part of boost::lambda::if_, so I am using a dummy var "a" to check it after the
completes.
My question is: what is the right way to use lambda control structure in
loop this
case?
Maybe you want std::find_if instead of std::for_each?
Well, what I have to do is to iterate through each and every element of the container and calculate validity of the element. If current element fails the test I don't have to continue further. I don't think that std::find_if would work in this case. My question is more to how the control structure of "lambda" library works in respect to "return" or "brake" in the cycle.