1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-04 19:21:46 +00:00

Make sure Variant is not implicitely cast when using operator[]

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
This commit is contained in:
Gilles Roudière
2021-06-09 21:11:06 +02:00
parent c4fb119f03
commit a825f955ab

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