diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/boost/libs/chrono/test/rep.h | |
parent | Initial commit. (diff) | |
download | ceph-upstream/16.2.11+ds.tar.xz ceph-upstream/16.2.11+ds.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/chrono/test/rep.h')
-rw-r--r-- | src/boost/libs/chrono/test/rep.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/boost/libs/chrono/test/rep.h b/src/boost/libs/chrono/test/rep.h new file mode 100644 index 000000000..b7e4ca273 --- /dev/null +++ b/src/boost/libs/chrono/test/rep.h @@ -0,0 +1,67 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// Adaptation to Boost of the libcxx +// Copyright 2010 Vicente J. Botet Escriba +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#ifndef REP_H +#define REP_H + +#include <boost/config.hpp> + +class Rep +{ +public: + int data_; + BOOST_CONSTEXPR Rep() : data_() {} + explicit BOOST_CONSTEXPR Rep(int i) : data_(i) {} + + BOOST_CONSTEXPR bool operator==(int i) const {return data_ == i;} + BOOST_CONSTEXPR bool operator==(const Rep& r) const {return data_ == r.data_;} + + Rep& operator*=(Rep x) {data_ *= x.data_; return *this;} + Rep& operator/=(Rep x) {data_ /= x.data_; return *this;} +}; + +#if 0 +namespace std { + + template <> + struct numeric_limits<Rep> + { + static BOOST_CONSTEXPR Rep max BOOST_PREVENT_MACRO_SUBSTITUTION () + { + return Rep((std::numeric_limits<int>::max)()); + } + + }; +} // namespace std + +namespace boost { +namespace chrono { +template <> +struct duration_values<Rep> +{ + static BOOST_CONSTEXPR Rep zero() {return Rep(0);} + static BOOST_CONSTEXPR Rep max BOOST_PREVENT_MACRO_SUBSTITUTION () + { + return Rep((std::numeric_limits<int>::max)()); + } + + static BOOST_CONSTEXPR Rep min BOOST_PREVENT_MACRO_SUBSTITUTION () + { + return Rep(detail::numeric_limits<Rep>::lowest()); + } +}; + +} // namespace chrono +} // namespace boost +#endif +#endif // REP_H |