I have an object registered like:
eng->RegisterObjectType("MyType", sizeof(MyType), asOBJ_VALUE | asOBJ_POD);
eng->RegisterObjectBehaviour("MyType", asBEHAVE_CONSTRUCT, "void f(double)", ...
I have another function registered like:
eng->RegisterGlobalFunction("void myFunc(const MyType& x)", ...
I call the function in the script:
myFunc(60.0);
I get a compile error:
No matching signatures to myFunc(const double)
Candidates are:
void myFunc(const MyType&inout)
However, if I had registered the function like:
eng->RegisterGlobalFunction("void myFunc(const MyType&in)", ...
the engine properly constructs a new instance of MyType and passes it by reference to the function.
It seems like "const &inout" could have the same behavior as "const &in", but this is obviously not the case. Is there a reason for the difference?
Thanks