summaryrefslogtreecommitdiff
path: root/include/ftl/Flags.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ftl/Flags.h')
-rw-r--r--include/ftl/Flags.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/ftl/Flags.h b/include/ftl/Flags.h
index 932af2d9f9..708eaf5dde 100644
--- a/include/ftl/Flags.h
+++ b/include/ftl/Flags.h
@@ -120,10 +120,10 @@ public:
}
/* Tests whether any of the given flags are set */
- bool any(Flags<F> f) { return (mFlags & f.mFlags) != 0; }
+ bool any(Flags<F> f) const { return (mFlags & f.mFlags) != 0; }
/* Tests whether all of the given flags are set */
- bool all(Flags<F> f) { return (mFlags & f.mFlags) == f.mFlags; }
+ bool all(Flags<F> f) const { return (mFlags & f.mFlags) == f.mFlags; }
Flags<F> operator|(Flags<F> rhs) const { return static_cast<F>(mFlags | rhs.mFlags); }
Flags<F>& operator|=(Flags<F> rhs) {
@@ -153,6 +153,10 @@ public:
return *this;
}
+ inline Flags<F>& clear(Flags<F> f = static_cast<F>(~static_cast<U>(0))) {
+ return *this &= ~f;
+ }
+
Iterator begin() const { return Iterator(*this); }
Iterator end() const { return Iterator(); }