min_max.hpp 908 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef BOOST_MPL_MIN_MAX_HPP_INCLUDED
  2. #define BOOST_MPL_MIN_MAX_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2000-2008
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // See http://www.boost.org/libs/mpl for documentation.
  10. // $Id$
  11. // $Date$
  12. // $Revision$
  13. #include <boost/mpl/less.hpp>
  14. #include <boost/mpl/if.hpp>
  15. #include <boost/mpl/aux_/na_spec.hpp>
  16. namespace boost { namespace mpl {
  17. template<
  18. typename BOOST_MPL_AUX_NA_PARAM(N1)
  19. , typename BOOST_MPL_AUX_NA_PARAM(N2)
  20. >
  21. struct min
  22. : if_< less<N1,N2>,N1,N2 >
  23. {
  24. };
  25. template<
  26. typename BOOST_MPL_AUX_NA_PARAM(N1)
  27. , typename BOOST_MPL_AUX_NA_PARAM(N2)
  28. >
  29. struct max
  30. : if_< less<N1,N2>,N2,N1 >
  31. {
  32. };
  33. BOOST_MPL_AUX_NA_SPEC(2, min)
  34. BOOST_MPL_AUX_NA_SPEC(2, max)
  35. }}
  36. #endif // BOOST_MPL_MIN_MAX_HPP_INCLUDED