Fcitx
Classes
flags.h File Reference

Helper template class to make easier to use type safe enum flags. More...

#include <initializer_list>
#include <type_traits>
#include <fcitx-utils/macros.h>
Include dependency graph for flags.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  fcitx::Flags< Enum >
 Class provides bit flag support for Enum. More...
 

Detailed Description

Helper template class to make easier to use type safe enum flags.

Commonly, One can not do any arithmetic calculation with enum class type without using static_cast. To make enum flags easier, this template class Stores the actual flag value with enum.

Example:

enum class EnumTypeFlag { /* ... */ };
using EnumTypeFlags = Flags<EnumTypeFlag>;

Definition in file flags.h.