aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/common/bit_field.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/bit_field.h')
-rw-r--r--src/common/bit_field.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/common/bit_field.h b/src/common/bit_field.h
index 3ec061e6..8eab054b 100644
--- a/src/common/bit_field.h
+++ b/src/common/bit_field.h
@@ -1,4 +1,4 @@
-// Licensed under GPLv2
+// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
@@ -168,6 +168,12 @@ public:
}
}
+ // TODO: we may want to change this to explicit operator bool() if it's bug-free in VS2015
+ __forceinline bool ToBool() const
+ {
+ return Value() != 0;
+ }
+
private:
// StorageType is T for non-enum types and the underlying type of T if
// T is an enumeration. Note that T is wrapped within an enable_if in the