summaryrefslogtreecommitdiff
path: root/core/templates/rb_set.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/templates/rb_set.h')
-rw-r--r--core/templates/rb_set.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/templates/rb_set.h b/core/templates/rb_set.h
index 2de816769c..226ea979c9 100644
--- a/core/templates/rb_set.h
+++ b/core/templates/rb_set.h
@@ -99,6 +99,7 @@ public:
_FORCE_INLINE_ bool operator==(const Iterator &b) const { return E == b.E; }
_FORCE_INLINE_ bool operator!=(const Iterator &b) const { return E != b.E; }
+ explicit operator bool() const { return E != nullptr; }
Iterator(Element *p_E) { E = p_E; }
Iterator() {}
Iterator(const Iterator &p_it) { E = p_it.E; }
@@ -128,6 +129,8 @@ public:
_FORCE_INLINE_ ConstIterator() {}
_FORCE_INLINE_ ConstIterator(const ConstIterator &p_it) { E = p_it.E; }
+ explicit operator bool() const { return E != nullptr; }
+
private:
const Element *E = nullptr;
};