
22 Jul
2010
22 Jul
'10
11:45 a.m.
On Thu, Jul 22, 2010 at 5:36 AM, Conoscenza Silente
Hi All I created a lambda expression inside my std::for_each call. Inside it there is code like this one, but I have building error telling me that
error: expected primary-expression before ‘break’ error: expected `]' before ‘break’
Do you know what it is and how to fix it? The same applies to return statement Thanks AFG
namespace bl = boost::lambda; int a, b; bl::var_type< int >::type a_( bl::var( a ) ); bl::var_type< int >::type b_( bl::var( b ) );
std::for_each( v.begin(), v.end(), ( if_( a_ > _b_ ) [ std::cout << _1, break ] ));
'break' is not a lazy command, hence it will not work there. What are you even trying to do anyway?