min_max.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #ifndef BOOST_CONFIG_HPP
  15. # include <boost/config.hpp>
  16. #endif
  17. #
  18. #if defined(BOOST_HAS_PRAGMA_ONCE)
  19. # pragma once
  20. #endif
  21. #include <boost/interprocess/detail/config_begin.hpp>
  22. #include <boost/interprocess/detail/workaround.hpp>
  23. namespace boost {
  24. namespace interprocess {
  25. template<class T>
  26. const T &max_value(const T &a, const T &b)
  27. { return a > b ? a : b; }
  28. template<class T>
  29. const T &min_value(const T &a, const T &b)
  30. { return a < b ? a : b; }
  31. } //namespace interprocess {
  32. } //namespace boost {
  33. #include <boost/interprocess/detail/config_end.hpp>
  34. #endif //#ifndef BOOST_INTERPROCESS_DETAIL_MIN_MAX_HPP