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