Skip to content

Commit e4a4d76

Browse files
authored
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.
2 parents 340dde3 + 3db8549 commit e4a4d76

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

include/godot_cpp/classes/wrapped.hpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ class Wrapped {
9595
virtual ~Wrapped() {}
9696

9797
public:
98-
static StringName &get_class_static() {
99-
static StringName string_name = StringName("Wrapped");
98+
static const StringName &get_class_static() {
99+
static const StringName string_name = StringName("Wrapped");
100100
return string_name;
101101
}
102102

@@ -229,12 +229,12 @@ public:
229229
initialized = true; \
230230
} \
231231
\
232-
static ::godot::StringName &get_class_static() { \
233-
static ::godot::StringName string_name = ::godot::StringName(#m_class); \
232+
static const ::godot::StringName &get_class_static() { \
233+
static const ::godot::StringName string_name = ::godot::StringName(#m_class); \
234234
return string_name; \
235235
} \
236236
\
237-
static ::godot::StringName &get_parent_class_static() { \
237+
static const ::godot::StringName &get_parent_class_static() { \
238238
return m_inherits::get_class_static(); \
239239
} \
240240
\
@@ -439,12 +439,12 @@ public:
439439
\
440440
static void initialize_class() {} \
441441
\
442-
static ::godot::StringName &get_class_static() { \
443-
static ::godot::StringName string_name = ::godot::StringName(#m_alias_for); \
442+
static const ::godot::StringName &get_class_static() { \
443+
static const ::godot::StringName string_name = ::godot::StringName(#m_alias_for); \
444444
return string_name; \
445445
} \
446446
\
447-
static ::godot::StringName &get_parent_class_static() { \
447+
static const ::godot::StringName &get_parent_class_static() { \
448448
return m_inherits::get_class_static(); \
449449
} \
450450
\

0 commit comments

Comments
 (0)