// ERROR! r = -10 (INVALID_DECLARATION)
r = engine->RegisterObjectBehaviour("Test", asBEHAVE_ASSIGNMENT, "void f(const Test &in)", asMETHOD(Test, operator=), asCALL_THISCALL);
// This works
//r = engine->RegisterObjectBehaviour("Test", asBEHAVE_ASSIGNMENT, "Test& f(const Test &in)", asMETHOD(Test, operator=), asCALL_THISCALL);
asBEHAVE_ASSIGN doesn't work with void return
The following code causes an error:
Is there any specific reason this is disallowed, or is this a bug?
It's more for not opening up features before they have been thoroughly thought through, so that I won't have to remove them afterwards. Allowing other return types than the reference of the type, opens up more paths that need to be tested and I haven't had the time to analyse the true impacts of that yet.
Do you have any specific needs for not returning the reference of the object after an assignment?
Do you have any specific needs for not returning the reference of the object after an assignment?
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
I don't have a particular reason for it. The reason I asked it is that for some reason TinyXML (which I'm trying to bind with my auto-binder) has it this way.
Since I'm generating wrapper functions anyway, it's easy to provide an AS compatible signature. I was just wondering why it was this way, no need to consider this a feature request :). It may be useful to mention it in the documentation, though.
Since I'm generating wrapper functions anyway, it's easy to provide an AS compatible signature. I was just wondering why it was this way, no need to consider this a feature request :). It may be useful to mention it in the documentation, though.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement