1<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> 2<html> 3<head> 4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 5 <meta name="GENERATOR" content="Mozilla/4.77 [en] (X11; U; Linux 2.2.19 i686) [Netscape]"> 6 <meta name="Author" content="Herve Bronnimann"> 7 <meta name="Description" content="Small library to propose minmax_element algorithm."> 8 <title>Boost minmax library synopsis</title> 9</head> 10<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000"> 11 12<center> 13<h1> 14Minmax_element complete synopsis</h1></center> 15 16<h3> 17Synopsis of <tt><boost/algorithm/minmax.hpp></tt></h3> 18 19<pre>#include <boost/tuple/tuple.hpp> 20 21namespace boost { 22 23 template <class T> 24 tuple<T const&, T const&> > 25 minmax(const T& a, const T& b); 26 27 template <class T, class <a href="https://www.boost.org/sgi/stl/BinaryPredicate.html">BinaryPredicate</a>> 28 tuple<T const&, T const&> > 29 minmax(const T& a, const T& b, BinaryPredicate comp); 30 31} 32</pre> 33 34<h3> 35Synopsis of <tt><boost/algorithm/minmax_element.hpp></tt></h3> 36 37<pre>#include <utility> //for std::pair 38 39namespace boost { 40 41 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>> 42 std::pair<ForwardIterator,ForwardIterator> 43 minmax_element(ForwardIterator first, ForwardIterator last); 44 45 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>, class <a href="https://www.boost.org/sgi/stl/BinaryPredicate.html">BinaryPredicate</a>> 46 std::pair<ForwardIterator,ForwardIterator> 47 minmax_element(ForwardIterator first, ForwardIterator last, 48 BinaryPredicate comp); 49 50 // Variants 51 52 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>> 53 ForwardIterator first_min_element(ForwardIterator first, ForwardIterator last); 54 55 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>, class <a href="https://www.boost.org/sgi/stl/BinaryPredicate.html">BinaryPredicate</a>> 56 ForwardIterator first_min_element(ForwardIterator first, ForwardIterator last, 57 BinaryPredicate comp); 58 59 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>> 60 ForwardIterator last_min_element(ForwardIterator first, ForwardIterator last); 61 62 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>, class <a href="https://www.boost.org/sgi/stl/BinaryPredicate.html">BinaryPredicate</a>> 63 ForwardIterator last_min_element(ForwardIterator first, ForwardIterator last, 64 BinaryPredicate comp); 65 66 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>> 67 ForwardIterator first_max_element(ForwardIterator first, ForwardIterator last); 68 69 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>, class <a href="https://www.boost.org/sgi/stl/BinaryPredicate.html">BinaryPredicate</a>> 70 ForwardIterator first_max_element(ForwardIterator first, ForwardIterator last, 71 BinaryPredicate comp); 72 73 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>> 74 ForwardIterator last_max_element(ForwardIterator first, ForwardIterator last); 75 76 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>, class <a href="https://www.boost.org/sgi/stl/BinaryPredicate.html">BinaryPredicate</a>> 77 ForwardIterator last_max_element(ForwardIterator first, ForwardIterator last, 78 BinaryPredicate comp); 79 80 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>> 81 std::pair<ForwardIterator,ForwardIterator> 82 first_min_first_max_element(ForwardIterator first, ForwardIterator last); 83 84 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>, class <a href="https://www.boost.org/sgi/stl/BinaryPredicate.html">BinaryPredicate</a>> 85 std::pair<ForwardIterator,ForwardIterator> 86 first_min_first_max_element(ForwardIterator first, ForwardIterator last, 87 BinaryPredicate comp); 88 89 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>> 90 std::pair<ForwardIterator,ForwardIterator> 91 first_min_last_max_element(ForwardIterator first, ForwardIterator last); 92 93 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>, class <a href="https://www.boost.org/sgi/stl/BinaryPredicate.html">BinaryPredicate</a>> 94 std::pair<ForwardIterator,ForwardIterator> 95 first_min_last_max_element(ForwardIterator first, ForwardIterator last, 96 BinaryPredicate comp); 97 98 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>> 99 std::pair<ForwardIterator,ForwardIterator> 100 last_min_first_max_element(ForwardIterator first, ForwardIterator last); 101 102 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>, class <a href="https://www.boost.org/sgi/stl/BinaryPredicate.html">BinaryPredicate</a>> 103 std::pair<ForwardIterator,ForwardIterator> 104 last_min_first_max_element(ForwardIterator first, ForwardIterator last, 105 BinaryPredicate comp); 106 107 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>> 108 std::pair<ForwardIterator,ForwardIterator> 109 last_min_last_max_element(ForwardIterator first, ForwardIterator last); 110 111 template <class <a href="https://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator</a>, class <a href="https://www.boost.org/sgi/stl/BinaryPredicate.html">BinaryPredicate</a>> 112 std::pair<ForwardIterator,ForwardIterator> 113 last_min_last_max_element(ForwardIterator first, ForwardIterator last, 114 BinaryPredicate comp); 115 116}</pre> 117 118<hr SIZE="6"> 119<br>Last modified 2002-07-01 120<p><font face="Arial,Helvetica"><font size=-1>© Copyright Hervé 121Brönnimann, Polytechnic University, 2002--2004. 122Use, modification, and distribution is subject to the Boost Software 123License, Version 1.0. (See accompanying file <a href="../../../../LICENSE_1_0.txt">License_1_0.txt</a> or copy at 124<a href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>) 125</font></font> 126</body> 127</html> 128