From 14a368e95cb444946d15bd018f400eeb94f6896e Mon Sep 17 00:00:00 2001 From: graehl Date: Tue, 6 Jul 2010 23:15:12 +0000 Subject: comment git-svn-id: https://ws10smt.googlecode.com/svn/trunk@171 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/inside_outside.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'decoder/inside_outside.h') 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); -- cgit v1.2.3