<div dir="ltr">Using the code snippet below as an example,...<br><br>#include <vector><br>#include <algorithm><br>#include <functional><br>#include "boost/lambda/lambda.hpp"<br>#include "boost/lambda/bind.hpp"<br> #include <boost/function.hpp><br><br>struct S { int methodOfS( ); };<br><br>int main( )<br>{<br> typedef std :: vector<S *> Vec;<br> using namespace boost :: lambda;<br><br> boost :: function<int( S * )> fn = bind( & S :: methodOfS, _1 );<br> Vec v;<br> Vec :: iterator match;<br><br> match = find_if( v.begin( ), v.end( ), bind( fn, _1 ) != fn( * v.begin( ) ) ); // OK<br><br> match = find_if( v.begin( ), v.end( ), fn( _1 ) != fn( * v.begin( ) ) ); // Fail<br> }<br><br clear="all">I find the line marked 'OK' compiles, but not the line marked 'Fail'. Isn't the<br>very point of Boost.Bind to enable this kind of syntax? Is there a better<br>way to write it than my 'Fail' line, but which will still compile?<br> <br>Thanks, Rob.<br>-- <br>ACCU - Professionalism in programming - <a href="http://www.accu.org">http://www.accu.org</a> </div>