diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-05-21 01:06:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-21 01:06:21 +0200 |
commit | 8adf04804550957f43c810b13fcce66dd76e5fd8 (patch) | |
tree | 2ee58365f1092587277770ceaedfc1e35454acfd /core/templates/rb_set.h | |
parent | f4126cc902b0cbb100bcf1b37ee15df5a8430d21 (diff) | |
parent | 45af29da8095af16729955117a165d23e77cd740 (diff) |
Merge pull request #61194 from reduz/new-hash-set
Add a new HashSet template
Diffstat (limited to 'core/templates/rb_set.h')
-rw-r--r-- | core/templates/rb_set.h | 3 |
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; }; |