c++ - boost::lambda::var nested in boost::bind not equivalent to boost::lambda::var by itself -


i'm having little trouble identifying simple boost::lambda usage issues. can make simple lambda function this:

int = 0; boost::lambda::var(i) = boost::lambda::_3; // set 'i' 3rd parameter. 

but wrap lambda function in bind:

int = 0; boost::bind(boost::lambda::var(i) = boost::lambda::_3);  // set 'i' 3rd parameter. 

it becomes unusable:

(boost::lambda::var(i) = boost::lambda::_3)(0,1,2); // compiles & behaves expected. == 2 boost::bind(boost::lambda::var(i) = boost::lambda::_3)(0, 1, 2); // compile error 

does boost::lambda::var indeed produce bindable function? have fudged syntax somehow? tends simple, light shed appreciated :)

(compiled msvc2008 & boost v1.50)

i think need prevent substitution

in case boost::lambda::protect seems in order

also, check relation of boost bind boost lambda:

http://www.boost.org/doc/libs/1_55_0/doc/html/lambda/s08.html#idp153645176

the boost bind [bind] library has partially overlapping functionality bll. basically, boost bind library (bb in sequel) implements bind expression part of bll. there are, however, semantical differerences.

the bll , bb evolved separately, , have different implementations. means the bind expressions bb cannot used within bind expressions, or within other type of lambda expressions, of bll. same holds using bll bind expressions in bb. libraries can coexist, however, names of bb library in boost namespace, whereas bll names in boost::lambda namespace.

and more information on page


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -