min_max.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2005-2012.
  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/interprocess for documentation.
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12. #ifndef BOOST_INTERPROCESS_DETAIL_MIN_MAX_HPP
  13. #define BOOST_INTERPROCESS_DETAIL_MIN_MAX_HPP
  14. #if (defined _MSC_VER) && (_MSC_VER >= 1200)
  15. # pragma once
  16. #endif
  17. #include <boost/interprocess/detail/config_begin.hpp>
  18. #include <boost/interprocess/detail/workaround.hpp>
  19. namespace boost {
  20. namespace interprocess {
  21. template<class T>
  22. const T &max_value(const T &a, const T &b)
  23. { return a > b ? a : b; }
  24. template<class T>
  25. const T &min_value(const T &a, const T &b)
  26. { return a < b ? a : b; }
  27. } //namespace interprocess {
  28. } //namespace boost {
  29. #include <boost/interprocess/detail/config_end.hpp>
  30. #endif //#ifndef BOOST_INTERPROCESS_DETAIL_MIN_MAX_HPP