From ec606bbf144945b7329b76ac3f3dd9ee0c7a8f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Br=C3=B6nnimann?= Date: Thu, 1 Jul 2004 19:23:33 +0000 Subject: [PATCH] Change pair to tuple in return type of minmax() [SVN r23307] --- include/boost/algorithm/minmax.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/boost/algorithm/minmax.hpp b/include/boost/algorithm/minmax.hpp index 1c15222..e4936e3 100644 --- a/include/boost/algorithm/minmax.hpp +++ b/include/boost/algorithm/minmax.hpp @@ -30,7 +30,8 @@ */ #include // for std::pair and std::make_pair -#include // for boost::cref +#include // for using pairs with boost::cref +#include // for using pairs with boost::cref namespace boost { @@ -56,15 +57,15 @@ namespace boost { } // namespace detail template - std::pair< boost::reference_wrapper, reference_wrapper > + tuple< T const&, T const& > minmax(T const& a, T const& b) { - return (b - std::pair< boost::reference_wrapper, reference_wrapper > + tuple< T const&, T const& > minmax(T const& a, T const& b, BinaryPredicate comp) { - return comp(b,a) ? std::make_pair(cref(b),cref(a)) : std::make_pair(cref(a),cref(b)); + return comp(b,a) ? make_tuple(cref(b),cref(a)) : make_tuple(cref(a),cref(b)); } namespace detail { // common base for the two minmax_element overloads