From e703c6289a7468572334427ec586163203ee0d7e Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Sun, 1 Mar 2026 14:48:45 +0100 Subject: [PATCH] Fix crafty's ++ and -- operators for BE --- include/dusk/endian.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 {