123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #ifndef BOOST_ALGORITHM_MINMAX_HPP
- #define BOOST_ALGORITHM_MINMAX_HPP
- #include <boost/config.hpp>
- #include <boost/tuple/tuple.hpp>
- #include <boost/ref.hpp>
- namespace boost {
- template <typename T>
- tuple< T const&, T const& >
- minmax(T const& a, T const& b) {
- return (b<a) ? make_tuple(cref(b),cref(a)) : make_tuple(cref(a),cref(b));
- }
- template <typename T, class BinaryPredicate>
- tuple< T const&, T const& >
- minmax(T const& a, T const& b, BinaryPredicate comp) {
- return comp(b,a) ? make_tuple(cref(b),cref(a)) : make_tuple(cref(a),cref(b));
- }
- }
- #endif
|