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