#include #include #include #include "bind.hpp" template bool equ(T1 t1, T2 t2/*, double threshold*/) { return t1 == t2; } template bool equthres(T1 t1, T2 t2, double threshold) { return std::fabs (double (t1 - t2)) <= threshold; } int main(int argc, char* argv[]) { int ia1[] = {1,2,3,4,5}; std::cout << *std::find_if(ia1, ia1+5, boost::bind(equ, _1, 5)) << std::endl; std::cout << *std::find_if(ia1, ia1+5, boost::bind(equthres, _1, 5, 2.0)) << std::endl; return 0; }