From 1289e7ad2228220d0eee61ed8db5ebcdf646db1f Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Sat, 27 Jun 2015 21:47:47 -0500 Subject: [PATCH] xe::be basic arithmetic operators --- src/xenia/base/byte_order.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xenia/base/byte_order.h b/src/xenia/base/byte_order.h index 5aed576f7..0f1078317 100644 --- a/src/xenia/base/byte_order.h +++ b/src/xenia/base/byte_order.h @@ -83,6 +83,14 @@ struct be { be(const T &src) : value(xe::byte_swap(src)) {} be(const be &other) { value = other.value; } operator T() const { return xe::byte_swap(value); } + + be& operator+=(int a) { *this = *this + a; return *this; } + be& operator-=(int a) { *this = *this - a; return *this; } + be& operator++() { *this += 1; return *this; } // ++a + be operator++(int) { *this += 1; return (*this - 1); } // a++ + be& operator--() { *this -= 1; return *this; } // --a + be operator--(int) { *this -= 1; return (*this + 1); } // a-- + T value; };