diff --git a/include/dusk/endian.h b/include/dusk/endian.h index 50e476accd..a105ec134e 100644 --- a/include/dusk/endian.h +++ b/include/dusk/endian.h @@ -82,14 +82,17 @@ struct BE { inner = swap(from); } - T operator--(int dec) { - inner -= dec; - return swap(inner); + // post-ops + T operator--(int) { + T orig = inner; + this -= 1; + return swap(orig); } - T operator++(int inc) { - inner += inc; - return swap(inner); + T operator++(int) { + T orig = inner; + this += 1; + return swap(orig); } operator T() const {