Does this casting have problems?
No.
If this casting makes sense, then why? Based on my understanding, options define only two variables, how does the value 0x03 make sense?
The Options enumeration type has two named enumerations, but the range of values it represents is large enough to be used as a bit field containing each of the counters.
In short: yes, it is valid and clearly defined to use an enumeration for a bit field like this.
As stated in the comments on this answer, the official language allowing this can be found in the C ++ standard (C ++ 03 7.2 / 6):
For an enumeration, where e min is the smallest enumerator and e max is the largest, the enumeration values are the values of the base type in the range b min to b max , where b min and b max are the smallest and largest values, respectively, the smallest bit field that can store e min and e max .
You can define an enumeration that has values that are not defined by any of its counters.
There is some debate as to whether this style is good. Of course, it can be argued that it is often assumed that an enumeration object can store only one of its counters, so this code can be confusing and error prone.
On the other hand, I would say that this is usually quite obvious when an enumeration is intended to be used as a bit field. Typically, such an enumeration is called the suffix Options or Flags or something similar. Similarly, if each of the counters has a given value, which is clearly the only bit in the set, this enumeration is probably intended to be used as a bit field.