summaryrefslogtreecommitdiff
path: root/decoder/inside_outside.h
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-06 23:15:12 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-06 23:15:12 +0000
commit14a368e95cb444946d15bd018f400eeb94f6896e (patch)
tree8ef68f7b79cd6c7fb26640d998f4675a59a8f8af /decoder/inside_outside.h
parent55da6f6d4e924769cea9463c1967e4405317a8c5 (diff)
comment
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@171 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/inside_outside.h')
-rw-r--r--decoder/inside_outside.h4
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);