Chris@16: // (C) Copyright Herve Bronnimann 2004. Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: /* Chris@16: Revision history: Chris@16: 1 July 2004 Chris@16: Split the code into two headers to lessen dependence on Chris@16: Boost.tuple. (Herve) Chris@16: 26 June 2004 Chris@16: Added the code for the boost minmax library. (Herve) Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_ALGORITHM_MINMAX_HPP Chris@16: #define BOOST_ALGORITHM_MINMAX_HPP Chris@16: Chris@16: /* PROPOSED STANDARD EXTENSIONS: Chris@16: * Chris@16: * minmax(a, b) Chris@16: * Effect: (b // for using pairs with boost::cref Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: Chris@16: template Chris@16: tuple< T const&, T const& > Chris@16: minmax(T const& a, T const& b) { Chris@16: return (b Chris@16: tuple< T const&, T const& > Chris@16: minmax(T const& a, T const& b, BinaryPredicate comp) { Chris@16: return comp(b,a) ? make_tuple(cref(b),cref(a)) : make_tuple(cref(a),cref(b)); Chris@16: } Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #endif // BOOST_ALGORITHM_MINMAX_HPP