Commit Graph

4 Commits (3ab36cb93412c39b9bf7cd69c7fe8845f9294405)

Author SHA1 Message Date
Vincent Coubard 79bd3ea982 BLE: Fix relationnal operator of SafeEnum
The relationnal operators were targeting the base class which defines an implicit constructor to an integral value. This is wrong as it allows SafeEnum instances to be compared against integers.

The fix is simple: define relationnal operators for the derived class. The derived class is known as it is passed as a template parameter of the base class.

For extra safety the SafeEnum constructor is now explicit and protected.
2019-01-16 16:06:21 +00:00
Vincent Coubard ce2460a92a BLE: expose representation type and pointer to the inner storage in SafeEnum. 2018-11-26 10:24:35 +00:00
Vincent Coubard 27d36ba820 BLE: Add missing relational operator to SafeEnum. 2018-04-26 17:07:54 +01:00
Vincent Coubard a917b90e0b BLE: Add safe Enum abstraction. 2017-10-15 16:37:38 +01:00