Здравствуйте, Stas Chistyakov, Вы писали:
#include <vector>
#include<algorithm>
#include <boost/compose.hpp>
#include <boost/mem_fn.hpp>
using namespace std;
using namespace boost;
class CTest
{
int _n1, _n2;
public:
CTest(int n1, int n2) : _n1(n1), _n2(n2) {}
int GetN1() { return _n1; }
int GetN2() { return _n2; }
};
int main(int argc, char** argv)
{
vector<CTest*> arr;
arr.push_back(new CTest(1, 2));
arr.push_back(new CTest(3, 4));
//for(vector<CTest*>::iterator it = arr.begin(); it != arr.end();++it)
// if(compose_f_gx(bind2nd(equal_to<int>(), 1), mem_fn(&CTest::GetN1))(*it))
// break;
vector<CTest*>::iterator it = find_if(arr.begin(), arr.end(),
compose_f_gx(bind2nd(equal_to<int>(), 3), mem_fn(&CTest::GetN1)));
return 0;
}