Monday, June 23, 2025 15:31

Posts Tagged ‘bit mask’

Bit masks and the Flags enumerations attribute

Sunday, July 16th, 2017

Most programmers use enums just so they can enforce a predefined set of options from which users can chose. However, enums have one major disadvantage: they can only hold one value at a time. Let’s say we have the following code:

[raw]
[/raw]

In this case, specifying that we want to have a direction towards left seems OK.… Read more