Ah! Thanks! I see what you mean.
Even when looking for it, it took me a little while to see that the opPreInc and opPostInc functions returned a bool. Our scripters missed it too ;)
In C++, the convention for these operators is usually to return a reference to the object itself, or a copy (for postInc).
This is convenient in some cases, for instance when pasing them as arguments.
I really like that you thought about minimizing AS function calls in the for loop though, so I would definitely appreciate a method for this, so that the current behaviour can still be used. Good thinking!
I've tested out the solution you proposed for our String handling, and it works great. Thank you.
During testing, I did come accross another small bug, regarding opCmp. The angelscript manual states the following:
"The comparison operators are rewritten as a.opCmp(b) op 0 and 0 op b.opCmp(a) and then the best match is used. The opCmp method must be implemented to return a int in order to be considered by the compiler. If the method argument is to be considered larger than the object then the method should return a negative value. If they are supposed to be equal the return value should be 0."
So for the less operator, the function returns a negative value. Not necessarily -1. I found AATC just checks for -1.
For performance reasons, (and to follow the example of strcmp, our String is implemented to return the numerical difference between the first mismatching characters which will often be smaller than -1.
I managed to fix it by changing line 232 in aatc_container_shared.cpp as follows:
result = (cc->GetReturnDWord() == -1); //Should be.. result = ((int)cc->GetReturnDWord() < 0);
opCmp is expected to return an int, so this sould be fine.
With that said, it seems like everything is in order now. I can use Strings directly, or use String@, so the scripter can decide for them selfs if they want to copy string or not ;-)
As for the Hash function, sure, I would gladly specify one manually.
Thanks again for your reply, and keep up the good work!