blob: 1c76582d372535d67c468137f642ff69d15d199d [file] [log] [blame]
Marshall Clow354d39c2014-01-16 16:58:45 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Howard Hinnant3e519522010-05-11 19:42:16 +000010#ifndef REP_H
11#define REP_H
12
Eric Fiselier6b425402016-10-12 10:28:09 +000013#include "test_macros.h"
14
Howard Hinnant3e519522010-05-11 19:42:16 +000015class Rep
16{
17 int data_;
18public:
Eric Fiselier6b425402016-10-12 10:28:09 +000019 TEST_CONSTEXPR Rep() : data_(-1) {}
20 explicit TEST_CONSTEXPR Rep(int i) : data_(i) {}
Howard Hinnant3e519522010-05-11 19:42:16 +000021
Eric Fiselier6b425402016-10-12 10:28:09 +000022 bool TEST_CONSTEXPR operator==(int i) const {return data_ == i;}
23 bool TEST_CONSTEXPR operator==(const Rep& r) const {return data_ == r.data_;}
Howard Hinnant3e519522010-05-11 19:42:16 +000024
25 Rep& operator*=(Rep x) {data_ *= x.data_; return *this;}
26 Rep& operator/=(Rep x) {data_ /= x.data_; return *this;}
27};
28
Howard Hinnant94b2dd02010-08-22 00:59:46 +000029#endif // REP_H