All binding classes have `const` in their arguments, which sometimes makes them unusable
According to https://github.com/Zylann/godot_voxel/issues/357
And likely because of https://github.com/godotengine/godot-cpp/blob/63df6debdf855be083e8eb877a0b92600a228e20/binding_generator.py#L466
Forcing const on all method arguments can make some arguments unusable. In the present case I expose a virtual method receiving a Ref<T> which is supposed to be modified by the implementation (through calling its non-const methods), but it can't because of the const.
Something like this cannot be done properly until Godot actually exposes a hint per method argument saying if the object is const or not.
Is there a suitable work-around for now? will modifying the binding_generator.py to remove the const for certain prototypes be sufficient? or could that break other things?
I believe removing the const should not break anything. I'm not sure why it's there. Maybe @vnen knows
There were some changes and now it moved here: https://github.com/godotengine/godot-cpp/blob/4d9fe6dfaaee892e9b369093c20df9fe1a2ef767/binding_generator.py#L1403
As I described in comment https://github.com/godotengine/godot/pull/64789#issuecomment-1546853406, the real problem here is the design flaw on Ref<T>::operator->. If that issue is fixed, we are going to have correct semantics, so no further changes will be required regardless of whether the parameter is Ref<T> param or const Ref<T>& param.