c++11 - Pass Through Delayed Function Call -
i have lot of functors passing function testing work. goal these std::bind , not use lambdas. simple cases seem hard bind. first question here.
now want know if there pass through delayed function call can create bind. like: auto foo = std::bind( std::placeholders::_1 ) such foo( 13 ) return 13.
this same answer given on linked question:
so there way accomplish using std::integral_constant:
const int thirteen = 13; auto refwrap = bind( &std::integral_constant< int, thirteen >::operator int, std::integral_constant< int, thirteen >() ); this solve question, intents , purposes inferior lambda:
const int thirteen = 13; auto refwrap = [=](){ return thirteen; }; 
Comments
Post a Comment