diff options
| author | Bastiaan Olij <mux213@gmail.com> | 2019-05-02 23:03:06 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-02 23:03:06 +1000 |
| commit | 12732b5391de16670f9bb1b51266851fcf491a0b (patch) | |
| tree | c9cbdfc31d623d5fe53b079eb99ad2bfc6739f44 | |
| parent | 7defa6f77e956bb0bac005741518fa657d2a8753 (diff) | |
| parent | c5199a2fbf619249611cbf62d8e122eec9c1a825 (diff) | |
| download | redot-cpp-12732b5391de16670f9bb1b51266851fcf491a0b.tar.gz | |
Merge pull request #270 from Windfisch/add-variant-cast
Add a type conversion to Variant for anything that supports ___get_from_variant()
| -rw-r--r-- | include/core/Variant.hpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/core/Variant.hpp b/include/core/Variant.hpp index 310bd41..5f40013 100644 --- a/include/core/Variant.hpp +++ b/include/core/Variant.hpp @@ -226,6 +226,7 @@ public: operator NodePath() const; operator RID() const; operator godot_object *() const; + template <typename T> operator T*() const { return static_cast<T*>(T::___get_from_variant(*this)); } operator Dictionary() const; operator Array() const; |
