Fixes a bug in the example code in object type. Ref<MyReference> myref = Ref<MyReference>(memnew(MyReference));

The statement is a compile error which emits  use of overloaded operator '=' is ambiguous (with operand types 'Ref<FuncRef>' and 'FuncRef *')

This commit uses neikeq suggestion of Ref<MyReference> myref(memnew(MyReference));

Fixes #506
This commit is contained in:
cheeseburger
2017-12-28 14:35:38 -08:00
parent c65485e391
commit 3d603d50d8

View File

@@ -242,7 +242,7 @@ Declaring them must be done using Ref<> template. For example:
GDCLASS(MyReference, Reference);
};
Ref<MyReference> myref = memnew(MyReference);
Ref<MyReference> myref(memnew(MyReference));
``myref`` is reference counted. It will be freed when no more Ref<>
templates point to it.