Advertisement

enum bitfield

Started by January 28, 2025 03:37 PM
4 comments, last by HenryAWE 1 week ago

I just ran into the same issue as mentioned here:

https://www.gamedev.net/forums/topic/709510-enum-bit-flags/

Has this been implemented? I can't find it in the documentation or in the API.

Hi Jan,

no, this is still on the to-do list.

Regards,
Andreas

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

Advertisement

Good to know, thanks!

I can't reply to the linked issue, but Java sees it as the abstract Set<MyEnum> , with a “highly optimized” implementation in EnumSet<MyEnum> which uses a bitfield of ordinal indices of the enumeration literals.

Maybe we can have operator overloading for enumeration like C++ does?

For example, implement something like engine->RegisterEnumMethod("int opImplConv() const"), and support for registering enum_type opOr(enum_type) const, enum_type opAnd(enum_type) const as well.

None

Advertisement