Adding a GDCLASS to a godot_cpp List

Godot Version



I have built an object that uses the GDCLASS macro and extends Resource. I’d like to add instances of these objects to a godot::List. However, GDCLASS makes the assignment operator private, so using push_back causes a compile error. Is there a way for me to work around this, other than using Ref objects in my List?

class MyObject : public Resource {
GDCLASS(MyObject, Resource)

List<MyObject> my_list;
my_list.push_back(MyObject()); //compile error, assignment operator is private