Merge pull request #49469 from groud/remove_variant_operator

Make sure Variant is not implicitely cast when using operator[]
This commit is contained in:
Rémi Verschelde 2023-02-13 12:57:04 +01:00
commit edc2686687
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -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