Commit 1d20c7da authored by Aaron Wood's avatar Aaron Wood
Browse files

Bitwise operator templates for enums

When an enum is used to define bitwise flags that are meant to be
combined (FLAG_ONE | FLAG_TWO), the resultant value needs to be cast
back to the enum type in order to be stored in a variable of the same
type as the enum (as the result is a value of underlying_type of the
enum).

This adds a macro that allows templated bitwise operators to be defined
so that the enumerators can be used more cleanly in code, while
preserving type-safety.

Test:  unit-tests
Change-Id: I6f945236e430b644758d2030c9c358c655d84941
parent 2053650b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment