summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp/variant
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-02-01 14:22:26 -0600
committerDavid Snopek <dsnopek@gmail.com>2024-02-26 10:36:16 -0600
commitc4fde852e69e3f28975a60630ae2232f71321a56 (patch)
treeced8899ac862fbfa37131a736f41c74eb4d9cc4a /include/godot_cpp/variant
parent36847f6af0be548bae96429fa84d59f407b51582 (diff)
downloadredot-cpp-c4fde852e69e3f28975a60630ae2232f71321a56.tar.gz
Avoid creating most objects that Godot is going to use placement new to initialize
Diffstat (limited to 'include/godot_cpp/variant')
-rw-r--r--include/godot_cpp/variant/variant.hpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/godot_cpp/variant/variant.hpp b/include/godot_cpp/variant/variant.hpp
index 3c64791..7ec04d2 100644
--- a/include/godot_cpp/variant/variant.hpp
+++ b/include/godot_cpp/variant/variant.hpp
@@ -47,8 +47,6 @@ class ObjectID;
class Variant {
uint8_t opaque[GODOT_CPP_VARIANT_SIZE]{ 0 };
- _FORCE_INLINE_ GDExtensionVariantPtr _native_ptr() const { return const_cast<uint8_t(*)[GODOT_CPP_VARIANT_SIZE]>(&opaque); }
-
friend class GDExtensionBinding;
friend class MethodBind;
@@ -145,6 +143,7 @@ private:
static GDExtensionTypeFromVariantConstructorFunc to_type_constructor[VARIANT_MAX];
public:
+ _FORCE_INLINE_ GDExtensionVariantPtr _native_ptr() const { return const_cast<uint8_t(*)[GODOT_CPP_VARIANT_SIZE]>(&opaque); }
Variant();
Variant(std::nullptr_t n) :
Variant() {}