Thank you for your answer. boost::bind
void AddUserAge( int& age ) { ++age; }
int _tmain(int argc, _TCHAR* argv[]) { std::vector<_sUserData> vUserData; for( int i = 0; i < 10; ++i ) vUserData.push_back( _sUserData() ); std::for_each( vUserData.begin(), vUserData.end(), boost::bind( AddUserAge, boost::bind( &_sUserData::m_nUserAge, _1 ) ) ); return 0; }
This compiles in 1.33, but doesn't actually increment the age; the inner bind returns a temporary int by value, and the outer bind increments that.
Can you please try boost::bind
( &_sUserData::m_nUserAge, _1 ) and see if it helps?
--------------------------------------------------------------------------------
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users