diff options
Diffstat (limited to 'boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp')
-rw-r--r-- | boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp b/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp new file mode 100644 index 0000000000..78a0ce13e7 --- /dev/null +++ b/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp @@ -0,0 +1,44 @@ +// is_evenly_divisible_by.hpp --------------------------------------------------------------// + +// Copyright 2009-2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#ifndef BOOST_CHRONO_DETAIL_NO_WARNING_SIGNED_UNSIGNED_CMP_HPP +#define BOOST_CHRONO_DETAIL_NO_WARNING_SIGNED_UNSIGNED_CMP_HPP + +// +// We simply cannot include this header on gcc without getting copious warnings of the kind: +// +//../../../boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp:37: warning: comparison between signed and unsigned integer expressions +// +// And yet there is no other reasonable implementation, so we declare this a system header +// to suppress these warnings. +// + +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif + +namespace boost { +namespace chrono { +namespace detail { + + template <class T, class U> + bool lt(T t, U u) + { + return t < u; + } + + template <class T, class U> + bool gt(T t, U u) + { + return t > u; + } + +} // namespace detail +} // namespace detail +} // namespace chrono + +#endif // BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP |