#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>

class IntFinder {
public:
	explicit IntFinder(int value): m_value(value) { }
	bool check(int value) const { return m_value == value; }
private:
	int m_value;
};

int main() {
	IntFinder f(42);
	std::vector<int> vec = { 1, 3, 42, 5, 7 };
	auto finder = std::mem_fn(&IntFinder::check);
	auto pred = std::bind(finder, f, std::placeholders::_1);
	auto v = std::find_if(std::begin(vec), std::end(vec), pred);
	std::cout << *v << std::endl;
	return 0;
}