xref: /minix3/external/bsd/libc++/dist/libcxx/test/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 
104684ddb6SLionel Sambuc #ifndef REP_H
114684ddb6SLionel Sambuc #define REP_H
124684ddb6SLionel Sambuc 
134684ddb6SLionel Sambuc class Rep
144684ddb6SLionel Sambuc {
154684ddb6SLionel Sambuc     int data_;
164684ddb6SLionel Sambuc public:
Rep()174684ddb6SLionel Sambuc     _LIBCPP_CONSTEXPR Rep() : data_(-1) {}
Rep(int i)184684ddb6SLionel Sambuc     explicit _LIBCPP_CONSTEXPR Rep(int i) : data_(i) {}
194684ddb6SLionel Sambuc 
204684ddb6SLionel Sambuc     bool _LIBCPP_CONSTEXPR operator==(int i) const {return data_ == i;}
214684ddb6SLionel Sambuc     bool _LIBCPP_CONSTEXPR operator==(const Rep& r) const {return data_ == r.data_;}
224684ddb6SLionel Sambuc 
234684ddb6SLionel Sambuc     Rep& operator*=(Rep x) {data_ *= x.data_; return *this;}
244684ddb6SLionel Sambuc     Rep& operator/=(Rep x) {data_ /= x.data_; return *this;}
254684ddb6SLionel Sambuc };
264684ddb6SLionel Sambuc 
274684ddb6SLionel Sambuc #endif  // REP_H
28