diff options
| author | Hein-Pieter van Braam | 2017-08-24 22:58:51 +0200 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2017-08-24 23:08:24 +0200 |
| commit | cacced7e507f7603bacc03ae2616e58f0ede122a (patch) | |
| tree | 7af89373e86cd1a7af6ea04e10280084cabb7144 /core/object.h | |
| parent | 4aa2c18cb428ffde05c67987926736a9ca62703b (diff) | |
| download | godot-cacced7e507f7603bacc03ae2616e58f0ede122a.tar.gz godot-cacced7e507f7603bacc03ae2616e58f0ede122a.tar.zst godot-cacced7e507f7603bacc03ae2616e58f0ede122a.zip | |
Diffstat (limited to 'core/object.h')
| -rw-r--r-- | core/object.h | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/core/object.h b/core/object.h index ab1421e35..88229d27b 100644 --- a/core/object.h +++ b/core/object.h @@ -598,46 +598,6 @@ public: #endif } -// TODO: ensure 'this' is never NULL since it's UB, but by now, avoid warning flood -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wundefined-bool-conversion" -#endif - - template <class T> - T *cast_to() { - -#ifndef NO_SAFE_CAST - return SAFE_CAST<T *>(this); -#else - if (!this) - return NULL; - if (is_class_ptr(T::get_class_ptr_static())) - return static_cast<T *>(this); - else - return NULL; -#endif - } - - template <class T> - const T *cast_to() const { - -#ifndef NO_SAFE_CAST - return SAFE_CAST<const T *>(this); -#else - if (!this) - return NULL; - if (is_class_ptr(T::get_class_ptr_static())) - return static_cast<const T *>(this); - else - return NULL; -#endif - } - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - enum { NOTIFICATION_POSTINITIALIZE = 0, |
