summaryrefslogtreecommitdiff
path: root/runtime/offsets.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/offsets.h')
-rw-r--r--runtime/offsets.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/runtime/offsets.h b/runtime/offsets.h
index cc18bf4f74..7974111851 100644
--- a/runtime/offsets.h
+++ b/runtime/offsets.h
@@ -37,12 +37,28 @@ class Offset {
constexpr size_t SizeValue() const {
return val_;
}
+ Offset& operator+=(const size_t rhs) {
+ val_ += rhs;
+ return *this;
+ }
constexpr bool operator==(Offset o) const {
return SizeValue() == o.SizeValue();
}
constexpr bool operator!=(Offset o) const {
return !(*this == o);
}
+ constexpr bool operator<(Offset o) const {
+ return SizeValue() < o.SizeValue();
+ }
+ constexpr bool operator<=(Offset o) const {
+ return !(*this > o);
+ }
+ constexpr bool operator>(Offset o) const {
+ return o < *this;
+ }
+ constexpr bool operator>=(Offset o) const {
+ return !(*this < o);
+ }
protected:
size_t val_;