xref: /minix3/external/bsd/libc++/dist/libcxx/test/std/utilities/time/rep.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc //===----------------------------------------------------------------------===//
2*0a6a1f1dSLionel Sambuc //
3*0a6a1f1dSLionel Sambuc //                     The LLVM Compiler Infrastructure
4*0a6a1f1dSLionel Sambuc //
5*0a6a1f1dSLionel Sambuc // This file is dual licensed under the MIT and the University of Illinois Open
6*0a6a1f1dSLionel Sambuc // Source Licenses. See LICENSE.TXT for details.
7*0a6a1f1dSLionel Sambuc //
8*0a6a1f1dSLionel Sambuc //===----------------------------------------------------------------------===//
9*0a6a1f1dSLionel Sambuc 
10*0a6a1f1dSLionel Sambuc #ifndef REP_H
11*0a6a1f1dSLionel Sambuc #define REP_H
12*0a6a1f1dSLionel Sambuc 
13*0a6a1f1dSLionel Sambuc class Rep
14*0a6a1f1dSLionel Sambuc {
15*0a6a1f1dSLionel Sambuc     int data_;
16*0a6a1f1dSLionel Sambuc public:
Rep()17*0a6a1f1dSLionel Sambuc     _LIBCPP_CONSTEXPR Rep() : data_(-1) {}
Rep(int i)18*0a6a1f1dSLionel Sambuc     explicit _LIBCPP_CONSTEXPR Rep(int i) : data_(i) {}
19*0a6a1f1dSLionel Sambuc 
20*0a6a1f1dSLionel Sambuc     bool _LIBCPP_CONSTEXPR operator==(int i) const {return data_ == i;}
21*0a6a1f1dSLionel Sambuc     bool _LIBCPP_CONSTEXPR operator==(const Rep& r) const {return data_ == r.data_;}
22*0a6a1f1dSLionel Sambuc 
23*0a6a1f1dSLionel Sambuc     Rep& operator*=(Rep x) {data_ *= x.data_; return *this;}
24*0a6a1f1dSLionel Sambuc     Rep& operator/=(Rep x) {data_ /= x.data_; return *this;}
25*0a6a1f1dSLionel Sambuc };
26*0a6a1f1dSLionel Sambuc 
27*0a6a1f1dSLionel Sambuc #endif  // REP_H
28