
JaeWook Choi wrote:
vector<CTestClass>::iterator it_f1 = find_if(vecTestClass.begin(), vecTestClass.end(), bind(::PtInRect, &bind(&CTestClass::rc, _1), ptTest) ); // compile error!
You can't use &bind with boost::bind, only with boost::lambda::bind. If you want to keep using boost::bind: template<class T> struct address_of { typedef T* result_type; result_type operator()( T & t ) const { return &t; } }; vector<CTestClass>::iterator it_f1 = find_if(vecTestClass.begin(), vecTestClass.end(), bind( ::PtInRect, bind( address_of<RECT>(), bind(&CTestClass::rc, _1) ), ptTest ) ); If you switch to lambda::bind you might have problems with the __stdcall convention that PtInRect uses; bind<BOOL>( ::PtInRect, ... ) might get you around that.