diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-13 12:57:04 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-13 12:57:04 +0100 |
commit | edc2686687f352a065425319d535dd37e85f8122 (patch) | |
tree | bf21b58b46c0ba3a810c75d0da17bce9f295f6bc /core | |
parent | 98d5e0b72f697805143a4c989405f2b11404c09d (diff) | |
parent | a825f955abf8b60f506ae3fd5e1448cbe7080331 (diff) |
Merge pull request #49469 from groud/remove_variant_operator
Make sure Variant is not implicitely cast when using operator[]
Diffstat (limited to 'core')
-rw-r--r-- | core/variant/variant.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/variant/variant.h b/core/variant/variant.h index b2f31a6d57..f694e59051 100644 --- a/core/variant/variant.h +++ b/core/variant/variant.h @@ -346,6 +346,10 @@ public: bool is_one() const; bool is_null() const; + // Make sure Variant is not implicitly cast when accessing it with bracket notation (GH-49469). + Variant &operator[](const Variant &p_key) = delete; + const Variant &operator[](const Variant &p_key) const = delete; + operator bool() const; operator signed int() const; operator unsigned int() const; // this is the real one |