signed_unsigned_cmp.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // is_evenly_divisible_by.hpp --------------------------------------------------------------//
  2. // Copyright 2009-2010 Vicente J. Botet Escriba
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // See http://www.boost.org/LICENSE_1_0.txt
  5. #ifndef BOOST_CHRONO_DETAIL_NO_WARNING_SIGNED_UNSIGNED_CMP_HPP
  6. #define BOOST_CHRONO_DETAIL_NO_WARNING_SIGNED_UNSIGNED_CMP_HPP
  7. //
  8. // We simply cannot include this header on gcc without getting copious warnings of the kind:
  9. //
  10. //../../../boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp:37: warning: comparison between signed and unsigned integer expressions
  11. //
  12. // And yet there is no other reasonable implementation, so we declare this a system header
  13. // to suppress these warnings.
  14. //
  15. #if defined(__GNUC__) && (__GNUC__ >= 4)
  16. #pragma GCC system_header
  17. #elif defined __SUNPRO_CC
  18. #pragma disable_warn
  19. #elif defined _MSC_VER
  20. #pragma warning(push, 1)
  21. #endif
  22. namespace boost {
  23. namespace chrono {
  24. namespace detail {
  25. template <class T, class U>
  26. bool lt(T t, U u)
  27. {
  28. return t < u;
  29. }
  30. template <class T, class U>
  31. bool gt(T t, U u)
  32. {
  33. return t > u;
  34. }
  35. } // namespace detail
  36. } // namespace detail
  37. } // namespace chrono
  38. #if defined __SUNPRO_CC
  39. #pragma enable_warn
  40. #elif defined _MSC_VER
  41. #pragma warning(pop)
  42. #endif
  43. #endif // BOOST_CHRONO_DETAIL_NO_WARNING_SIGNED_UNSIGNED_CMP_HPP