Index: src/base/flags.h |
diff --git a/src/base/flags.h b/src/base/flags.h |
index 467ecf67c953dbb810ee69f03109a0279dc939ea..4d9e14e5f913fc8a8b8c9bb6fb88ca55b5150896 100644 |
--- a/src/base/flags.h |
+++ b/src/base/flags.h |
@@ -5,6 +5,8 @@ |
#ifndef V8_BASE_FLAGS_H_ |
#define V8_BASE_FLAGS_H_ |
+#include <cstddef> |
+ |
#include "src/base/compiler-specific.h" |
namespace v8 { |
@@ -30,6 +32,13 @@ class Flags final { |
: mask_(static_cast<S>(flag)) {} |
explicit Flags(mask_type mask) : mask_(static_cast<S>(mask)) {} |
+ bool operator==(flag_type flag) const { |
+ return mask_ == static_cast<S>(flag); |
+ } |
+ bool operator!=(flag_type flag) const { |
+ return mask_ != static_cast<S>(flag); |
+ } |
+ |
Flags& operator&=(const Flags& flags) { |
mask_ &= flags.mask_; |
return *this; |
@@ -60,6 +69,8 @@ class Flags final { |
operator mask_type() const { return mask_; } |
bool operator!() const { return !mask_; } |
+ friend size_t hash_value(const Flags& flags) { return flags.mask_; } |
+ |
private: |
mask_type mask_; |
}; |