# HG changeset patch # User Markus Mützel # Date 1659102200 -7200 # Node ID 4efd735d034cd3638d9d1d95139d37fc14892992 # Parent 731b6a5c7c4c914425282e1a3530509e6d11e1e7 octave_int: Overload operator ~ (). * liboctave/util/oct-inttypes.h (octave_int): Overload unary `operator ~` (bitwise NOT) to correct result for octave_uint8. See also: https://octave.discourse.group/t/3063 diff -r 731b6a5c7c4c -r 4efd735d034c liboctave/util/oct-inttypes.h --- a/liboctave/util/oct-inttypes.h Thu Jul 28 19:23:14 2022 -0400 +++ b/liboctave/util/oct-inttypes.h Fri Jul 29 15:43:20 2022 +0200 @@ -862,6 +862,12 @@ #undef OCTAVE_INT_UN_OP + octave_int operator ~ (void) const + { + T bitinv = ~ m_ival; + return bitinv; + } + // Homogeneous binary integer operations. #define OCTAVE_INT_BIN_OP(OP, NAME, ARGT) \ inline octave_int \