Sorry, it seems i deleted the question while tagging the code. Let me rewrite a better one
The script compiler has been enhanced to finally support implicit conversion from primitive types to registered value types by allowing the compiler to call the appropriate constructor.
Does this mean if i have constructor for a type like this "any(int val)" then i can call this?
any foo = 42;
I looked in tests folder but could not find new tests for this feature. It's committed in rev1568 but there are no new tests.
Implementing it like this did not give any fruit.
int r = engine->RegisterObjectType("any", sizeof(Any), asOBJ_VALUE | asOBJ_APP_CLASS_CDAK);assert(r >= 0); r = engine->RegisterObjectBehaviour("any", asBEHAVE_CONSTRUCT, "void f(uint)", asFUNCTIONPR(Any::CreateAny, (unsigned int, Any*),void), asCALL_CDECL_OBJLAST); assert(r >= 0);
compile error: There is not copy operator for the type any available
Adding an opAssign method works tho.