xe::be basic arithmetic operators
This commit is contained in:
parent
c228c0fa73
commit
1289e7ad22
|
@ -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<T>& operator+=(int a) { *this = *this + a; return *this; }
|
||||
be<T>& operator-=(int a) { *this = *this - a; return *this; }
|
||||
be<T>& operator++() { *this += 1; return *this; } // ++a
|
||||
be<T> operator++(int) { *this += 1; return (*this - 1); } // a++
|
||||
be<T>& operator--() { *this -= 1; return *this; } // --a
|
||||
be<T> operator--(int) { *this -= 1; return (*this + 1); } // a--
|
||||
|
||||
T value;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue