blob: 2ec3514ab567a20af884e2bdef10bb5d93137fbb [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
13class Rep
14{
15 int data_;
16public:
Howard Hinnantc0331152012-07-13 19:17:27 +000017 _LIBCPP_CONSTEXPR Rep() : data_(-1) {}
18 explicit _LIBCPP_CONSTEXPR Rep(int i) : data_(i) {}
Howard Hinnant3e519522010-05-11 19:42:16 +000019
Howard Hinnantc0331152012-07-13 19:17:27 +000020 bool _LIBCPP_CONSTEXPR operator==(int i) const {return data_ == i;}
21 bool _LIBCPP_CONSTEXPR operator==(const Rep& r) const {return data_ == r.data_;}
Howard Hinnant3e519522010-05-11 19:42:16 +000022
23 Rep& operator*=(Rep x) {data_ *= x.data_; return *this;}
24 Rep& operator/=(Rep x) {data_ /= x.data_; return *this;}
25};
26
Howard Hinnant94b2dd02010-08-22 00:59:46 +000027#endif // REP_H