19#ifndef BLE_SAFE_ENUM_H_
20#define BLE_SAFE_ENUM_H_
110template<
typename Target,
typename LayoutType =
unsigned int>
134 return lhs._value == rhs._value;
147 return !(lhs == rhs);
159 return lhs.value() < rhs.value();
172 return lhs.value() < rhs.value() || lhs == rhs;
185 return !(lhs <= rhs);
Entry namespace for all BLE API definitions.
Helper class used to define safe enumerations.
const LayoutType * storage() const
Return a pointer to the inner storage.
friend bool operator<(Target lhs, Target rhs)
Less than operator for Target instances.
friend bool operator<=(Target lhs, Target rhs)
Less than or equal to operator for Target instances.
SafeEnum(LayoutType value)
Construction of an enumeration value.
friend bool operator>(Target lhs, Target rhs)
Greater than operator for Target instances.
friend bool operator==(Target lhs, Target rhs)
Equal to operator for Target instances.
LayoutType value() const
Explicit access to the inner value of the SafeEnum instance.
LayoutType representation_t
Type of the representation.
friend bool operator!=(Target lhs, Target rhs)
Not equal to operator for Target instances.
friend bool operator>=(Target lhs, Target rhs)
Greater than or equal to operator for Target instances.