diff options
| author | David Snopek <dsnopek@gmail.com> | 2024-05-17 11:55:45 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-17 11:55:45 -0500 |
| commit | e4a4d76cb31b3f7f91720ad61ffbd383f9793c4a (patch) | |
| tree | a6b56ea1678b2c3c19efdfe6d8a17b921cf8803b /include/godot_cpp/classes | |
| parent | 340dde31a28222ed09a68176b5c658e531fd73d9 (diff) | |
| parent | 3db8549e19641d49dfcdf3055da6917699c07d1f (diff) | |
| download | redot-cpp-e4a4d76cb31b3f7f91720ad61ffbd383f9793c4a.tar.gz | |
Merge pull request #1463 from Daylily-Zeleen/daylily-zeleen/const_get_class_static
Mark return value of `get_class_static` and `get_parent_class_static` as const.
Diffstat (limited to 'include/godot_cpp/classes')
| -rw-r--r-- | include/godot_cpp/classes/wrapped.hpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp index ceed378..5d587a3 100644 --- a/include/godot_cpp/classes/wrapped.hpp +++ b/include/godot_cpp/classes/wrapped.hpp @@ -95,8 +95,8 @@ protected: virtual ~Wrapped() {} public: - static StringName &get_class_static() { - static StringName string_name = StringName("Wrapped"); + static const StringName &get_class_static() { + static const StringName string_name = StringName("Wrapped"); return string_name; } @@ -229,12 +229,12 @@ public: initialized = true; \ } \ \ - static ::godot::StringName &get_class_static() { \ - static ::godot::StringName string_name = ::godot::StringName(#m_class); \ + static const ::godot::StringName &get_class_static() { \ + static const ::godot::StringName string_name = ::godot::StringName(#m_class); \ return string_name; \ } \ \ - static ::godot::StringName &get_parent_class_static() { \ + static const ::godot::StringName &get_parent_class_static() { \ return m_inherits::get_class_static(); \ } \ \ @@ -439,12 +439,12 @@ public: \ static void initialize_class() {} \ \ - static ::godot::StringName &get_class_static() { \ - static ::godot::StringName string_name = ::godot::StringName(#m_alias_for); \ + static const ::godot::StringName &get_class_static() { \ + static const ::godot::StringName string_name = ::godot::StringName(#m_alias_for); \ return string_name; \ } \ \ - static ::godot::StringName &get_parent_class_static() { \ + static const ::godot::StringName &get_parent_class_static() { \ return m_inherits::get_class_static(); \ } \ \ |
