replace bind in STL_extension

This commit is contained in:
Sébastien Loriot 2021-01-05 18:35:57 +01:00
parent 0d16ef14c5
commit cef46c9ee6
2 changed files with 3 additions and 6 deletions

View File

@ -14,8 +14,7 @@ int main()
std::cout << "min_odd = " std::cout << "min_odd = "
<< *CGAL::min_element_if(v.begin(), << *CGAL::min_element_if(v.begin(),
v.end(), v.end(),
CGAL::compose1_1(boost::bind2nd(std::greater< int >(), 0), [](int i){ return (i%2) > 0; })
boost::bind2nd(std::modulus< int >(), 2)))
<< std::endl; << std::endl;
return 0; return 0;
} }

View File

@ -12,8 +12,6 @@ using CGAL::compose1_2;
using CGAL::compose2_1; using CGAL::compose2_1;
using CGAL::compose2_2; using CGAL::compose2_2;
using CGAL::compare_to_less; using CGAL::compare_to_less;
using boost::binder1st;
using boost::bind1st;
using std::accumulate; using std::accumulate;
using std::plus; using std::plus;
using std::multiplies; using std::multiplies;
@ -31,8 +29,8 @@ int main()
{ {
plus< int > pl; plus< int > pl;
multiplies< int > mu; multiplies< int > mu;
binder1st< plus< int > > op1 = bind1st(pl, 1); auto op1 = [](int i){ return i+1; };
binder1st< multiplies< int > > op2 = bind1st(mu, 2); auto op2 = [](int i){ return i * 2; };
// compose1_2: // compose1_2:
int a[] = {3,5,7,2,4}; int a[] = {3,5,7,2,4};