Notcurses 3.0.13
a blingful library for TUIs and character graphics
Loading...
Searching...
No Matches
_flag_enum_operator_helpers.hh File Reference
#include <type_traits>
#include "_helpers.hh"
Include dependency graph for _flag_enum_operator_helpers.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  ncpp
 

Macros

#define DECLARE_ENUM_FLAG_OPERATORS(__enum_name__)
 

Macro Definition Documentation

◆ DECLARE_ENUM_FLAG_OPERATORS

#define DECLARE_ENUM_FLAG_OPERATORS (   __enum_name__)

Definition at line 10 of file _flag_enum_operator_helpers.hh.

12 { \
13 typedef std::underlying_type<__enum_name__>::type etype; \
14 return __enum_name__ (static_cast<etype> (x) & static_cast<etype> (y)); \
15 } \
16 NCPP_API_EXPORT constexpr __enum_name__& operator&= (__enum_name__& x, __enum_name__ y) \
17 { \
18 typedef std::underlying_type<__enum_name__>::type etype; \
19 return x = __enum_name__ (static_cast<etype> (x) & static_cast<etype> (y)); \
20 } \
21 NCPP_API_EXPORT constexpr __enum_name__ operator| (__enum_name__ x, __enum_name__ y) \
22 { \
23 typedef std::underlying_type<__enum_name__>::type etype; \
24 return __enum_name__ (static_cast<etype> (x) | static_cast<etype> (y)); \
25 } \
26 NCPP_API_EXPORT constexpr __enum_name__& operator|= (__enum_name__& x, __enum_name__ y) \
27 { \
28 typedef std::underlying_type<__enum_name__>::type etype; \
29 return x = __enum_name__ (static_cast<etype> (x) | static_cast<etype> (y)); \
30 } \
31 NCPP_API_EXPORT constexpr __enum_name__ operator^ (__enum_name__ x, __enum_name__ y) \
32 { \
33 typedef std::underlying_type<__enum_name__>::type etype; \
34 return __enum_name__ (static_cast<etype> (x) ^ static_cast<etype> (y)); \
35 } \
36 NCPP_API_EXPORT constexpr __enum_name__& operator^= (__enum_name__& x, __enum_name__ y) \
37 { \
38 typedef std::underlying_type<__enum_name__>::type etype; \
39 return x = __enum_name__ (static_cast<etype> (x) ^ static_cast<etype> (y)); \
40 } \
41 NCPP_API_EXPORT constexpr __enum_name__& operator~ (__enum_name__& x) \
42 { \
43 typedef std::underlying_type<__enum_name__>::type etype; \
44 return x = __enum_name__ (~static_cast<etype> (x)); \
45 } \
46 NCPP_API_EXPORT constexpr __enum_name__ operator~ (__enum_name__ x) \
47 { \
48 typedef std::underlying_type<__enum_name__>::type etype; \
49 return __enum_name__ (~static_cast<etype> (x)); \
50 }
#define NCPP_API_EXPORT
Definition _helpers.hh:9
int y
Definition notcurses.h:1905
int int x
Definition notcurses.h:1905