]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/chrono/test/rep.h
1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
9 // Adaptation to Boost of the libcxx
10 // Copyright 2010 Vicente J. Botet Escriba
11 // Distributed under the Boost Software License, Version 1.0.
12 // See http://www.boost.org/LICENSE_1_0.txt
17 #include <boost/config.hpp>
23 BOOST_CONSTEXPR
Rep() : data_() {}
24 explicit BOOST_CONSTEXPR
Rep(int i
) : data_(i
) {}
26 BOOST_CONSTEXPR
bool operator==(int i
) const {return data_
== i
;}
27 BOOST_CONSTEXPR
bool operator==(const Rep
& r
) const {return data_
== r
.data_
;}
29 Rep
& operator*=(Rep x
) {data_
*= x
.data_
; return *this;}
30 Rep
& operator/=(Rep x
) {data_
/= x
.data_
; return *this;}
37 struct numeric_limits
<Rep
>
39 static BOOST_CONSTEXPR Rep max
BOOST_PREVENT_MACRO_SUBSTITUTION ()
41 return Rep((std::numeric_limits
<int>::max
)());
50 struct duration_values
<Rep
>
52 static BOOST_CONSTEXPR Rep
zero() {return Rep(0);}
53 static BOOST_CONSTEXPR Rep max
BOOST_PREVENT_MACRO_SUBSTITUTION ()
55 return Rep((std::numeric_limits
<int>::max
)());
58 static BOOST_CONSTEXPR Rep min
BOOST_PREVENT_MACRO_SUBSTITUTION ()
60 return Rep(detail::numeric_limits
<Rep
>::lowest());