Loading [MathJax]/extensions/TeX/newcommand.js
\newcommand{\E}{\mathrm{E}} \newcommand{\A}{\mathrm{A}} \newcommand{\R}{\mathrm{R}} \newcommand{\N}{\mathrm{N}} \newcommand{\Q}{\mathrm{Q}} \newcommand{\Z}{\mathrm{Z}} \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }
CGAL 4.12 - STL Extensions for CGAL
All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Modules Pages
STL_Extension/min_element_if_example.cpp
#include <CGAL/algorithm.h>
#include <CGAL/function_objects.h>
#include <vector>
#include <iostream>
#include <boost/functional.hpp>
int main()
{
std::vector< int > v;
v.push_back(3);
v.push_back(5);
v.push_back(2);
std::cout << "min_odd = "
<< *CGAL::min_element_if(v.begin(),
v.end(),
CGAL::compose1_1(boost::bind2nd(std::greater< int >(), 0),
boost::bind2nd(std::modulus< int >(), 2)))
<< std::endl;
return 0;
}