From 3d603d50d835c86ad4ad82574f6de9c3041ddc28 Mon Sep 17 00:00:00 2001 From: cheeseburger Date: Thu, 28 Dec 2017 14:35:38 -0800 Subject: [PATCH] Fixes a bug in the example code in object type. Ref myref = Ref(memnew(MyReference)); The statement is a compile error which emits use of overloaded operator '=' is ambiguous (with operand types 'Ref' and 'FuncRef *') This commit uses neikeq suggestion of Ref myref(memnew(MyReference)); Fixes #506 --- development/cpp/object_class.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/development/cpp/object_class.rst b/development/cpp/object_class.rst index 108cf57b..9a1420c5 100644 --- a/development/cpp/object_class.rst +++ b/development/cpp/object_class.rst @@ -242,7 +242,7 @@ Declaring them must be done using Ref<> template. For example: GDCLASS(MyReference, Reference); }; - Ref myref = memnew(MyReference); + Ref myref(memnew(MyReference)); ``myref`` is reference counted. It will be freed when no more Ref<> templates point to it.