diff options
Diffstat (limited to 'decoder/inside_outside.h')
-rw-r--r-- | decoder/inside_outside.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/decoder/inside_outside.h b/decoder/inside_outside.h index 9f7ce526..62daca1f 100644 --- a/decoder/inside_outside.h +++ b/decoder/inside_outside.h @@ -10,8 +10,8 @@ struct Boolean { bool x; Boolean() : x() { } Boolean(bool i) : x(i) { } - operator bool() const { return x; } - // normally you'd use the logical (short circuit) || && operators, but bool really is guaranteed to be 0 or 1 numerically. + operator bool() const { return x; } // careful - this might cause a disaster with (bool)a + Boolean(b). + // normally you'd use the logical (short circuit) || && operators, but bool really is guaranteed to be 0 or 1 numerically. also note that | and & have equal precedence (!) void operator+=(Boolean o) { x|=o.x; } friend inline Boolean operator +(Boolean a,Boolean b) { return Boolean(a.x|b.x); |