summaryrefslogtreecommitdiff
path: root/Runtime/Utilities/EnumFlags.h
blob: 61d323beb14d5f0e5236be71f7ad3386a5b47bbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef ENUM_FLAGS_H
#define ENUM_FLAGS_H

#define ENUM_FLAGS(T) \
inline T  operator  |(const T s, const T e) { return (T)((unsigned)s | e); } \
inline T &operator |=(T      &s, const T e) { return s = s | e; }            \
inline T  operator  &(const T s, const T e) { return (T)((unsigned)s & e); } \
inline T &operator &=(T      &s, const T e) { return s = s & e; }            \
inline T  operator  ^(const T s, const T e) { return (T)((unsigned)s ^ e); } \
inline T &operator ^=(T      &s, const T e) { return s = s ^ e; }            \
inline T  operator  ~(const T s)            { return (T)~(unsigned)s; }

#endif