Feb 11, 2022
You stumbled across the arcane practice of bit flags. I have used bit flags in the past, but not as much now. They are particularly useful for something that will have an unknown number of multiple flags in its default configuration. I don't tend to use them as much because in a lot of cases, flags are an anti-pattern and can be replaced with better object/functional composition. Most of my enum usage is to store commonly used values.