OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EnableBitmaskOps< T > Struct Template Reference

#include <EnumBitmaskOps.h>

Static Public Attributes

static const bool enable = false
 

Detailed Description

template<typename T>
struct EnableBitmaskOps< T >

Template operators to add typesafe bitwise operators to enum classes. These are intended for use with mask types, so shift operators are not provided as they can lead to invalid bits being set.

To avoid nest namespace issues, ENABLE_BITMASK_OPS must be used outside any namespaces

Example Usage: namespace my_namespace { enum class MyEnum : uint8_t { kEmpty = 0x00, kSomething = 0x01, kAnother = 0x02 }; } // namespace my_namespace

ENABLE_BITMASK_OPS(::my_namespace::MyEnum) MyEnum e = MyEnum::kSomething & MyEnum::kAnother;

Definition at line 42 of file EnumBitmaskOps.h.

Member Data Documentation

template<typename T >
const bool EnableBitmaskOps< T >::enable = false
static

Definition at line 43 of file EnumBitmaskOps.h.


The documentation for this struct was generated from the following file: