integer bitwise or

Started by
1 comment, last by Desdemona 19 years, 6 months ago
I noticed that integers do not normally support the bitwise-OR operator, so I tried to manually add it: RegisterObjectBehaviour(0, asBEHAVE_BIT_OR, "int f(int&, int&)", asFUNCTION(int_bitwise_or), asCALL_CDECL) But AS is returning error asINVALID_DECLARATION. Is it possible to do this, and if so, how?
Advertisement
It's not possible to register operators for default types.

For now you need to convert the integers to bits and then perform the bitwise or.

I'm considering changing the library to allow more implicit conversions, including int->bits.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Ahh, I didn't notice the bits datatypes. That helps.

This topic is closed to new replies.

Advertisement