This has happened to me a few times, and the solution is always kind of a weird workaround, so figured I'd ask if this could be implemented properly.
If I have an enum like this:
enum Things
{
None = 0,
Foo = (1 << 0),
Bar = (1 << 1),
}
And a function definition that accepts the enum:
void DoSomething(Things things);
I can't combine multiple flags together like this:
DoSomething(Things::Foo | Things::Bar);
Because it casts the result of the OR into an integer, and throws a “No matching signatures" compiler error. The workaround is to just make the parameter an int instead, but that's not great for documentation. Alternatively, I can cast it back to a “Things” enum type:
DoSomething(Things(Things::Foo | Things::Bar));
Is there something that can be done about this in Angelscript itself or would that be too complex?
(I might have made a thread asking about this before, sorry if I have :D I wasn't able to search only the Angelcode forum here.)