Hi,
while playing with the scriptany addon, I have found a bug when using the constructor with primitive types:
any myAny(10);
int myValue;
myAny.retrieve(myValue); // will fail
It is simply because the constructor is not defined for double or int64 (as opposed to the store function). Adding the following factory definitions in scriptany.cpp will fix this problem:
r = engine->RegisterObjectBehaviour("any", asBEHAVE_FACTORY, "any@ f(int64&in)", asFUNCTION(ScriptAnyFactory2_Generic), asCALL_GENERIC); assert( r >= 0 );
r = engine->RegisterObjectBehaviour("any", asBEHAVE_FACTORY, "any@ f(double&in)", asFUNCTION(ScriptAnyFactory2_Generic), asCALL_GENERIC); assert( r >= 0 );