summaryrefslogtreecommitdiff
path: root/src/common/utils2.hpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-12-06 14:15:43 -0800
committerBen Longbons <b.r.longbons@gmail.com>2013-12-06 14:15:49 -0800
commit3eea219548e84efdbc3148ce378fcba865f97a01 (patch)
tree6ece594f60ddff038cf9c1d94b99d8d66a00bc20 /src/common/utils2.hpp
parent1458563f00deebbbcf3e8049dc90157fb825fae3 (diff)
downloadtmwa-3eea219548e84efdbc3148ce378fcba865f97a01.tar.gz
tmwa-3eea219548e84efdbc3148ce378fcba865f97a01.tar.bz2
tmwa-3eea219548e84efdbc3148ce378fcba865f97a01.tar.xz
tmwa-3eea219548e84efdbc3148ce378fcba865f97a01.zip
Add basic source formatting tools
Diffstat (limited to 'src/common/utils2.hpp')
-rw-r--r--src/common/utils2.hpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/common/utils2.hpp b/src/common/utils2.hpp
index 7dbd741..0f72aff 100644
--- a/src/common/utils2.hpp
+++ b/src/common/utils2.hpp
@@ -1,19 +1,19 @@
#ifndef UTILS2_HPP
#define UTILS2_HPP
-#include "../sanity.hpp"
+# include "../sanity.hpp"
-#include <algorithm>
-#include <functional>
-#include <iterator>
-#include <memory>
-#include <type_traits>
+# include <algorithm>
+# include <functional>
+# include <iterator>
+# include <memory>
+# include <type_traits>
-#ifdef __clang__
-# define FALLTHROUGH [[clang::fallthrough]]
-#else
-# define FALLTHROUGH /* fallthrough */
-#endif
+# ifdef __clang__
+# define FALLTHROUGH [[clang::fallthrough]]
+# else
+# define FALLTHROUGH /* fallthrough */
+# endif
template<class T, class E, E max>
struct earray
@@ -136,44 +136,44 @@ struct remove_enum<E, true>
};
-#define ENUM_BITWISE_OPERATORS(E) \
-inline \
-E operator & (E l, E r) \
-{ \
- typedef underlying_type<E>::type U; \
- return E(U(l) & U(r)); \
-} \
-inline \
-E operator | (E l, E r) \
-{ \
- typedef underlying_type<E>::type U; \
- return E(U(l) | U(r)); \
-} \
-inline \
-E operator ^ (E l, E r) \
-{ \
- typedef underlying_type<E>::type U; \
- return E(U(l) ^ U(r)); \
-} \
-inline \
-E& operator &= (E& l, E r) \
-{ \
- return l = l & r; \
-} \
-inline \
-E& operator |= (E& l, E r) \
-{ \
- return l = l | r; \
-} \
-inline \
-E& operator ^= (E& l, E r) \
-{ \
- return l = l ^ r; \
-} \
-inline \
-E operator ~ (E r) \
-{ \
- return E(-1) ^ r; \
+# define ENUM_BITWISE_OPERATORS(E) \
+inline \
+E operator & (E l, E r) \
+{ \
+ typedef underlying_type<E>::type U; \
+ return E(U(l) & U(r)); \
+} \
+inline \
+E operator | (E l, E r) \
+{ \
+ typedef underlying_type<E>::type U; \
+ return E(U(l) | U(r)); \
+} \
+inline \
+E operator ^ (E l, E r) \
+{ \
+ typedef underlying_type<E>::type U; \
+ return E(U(l) ^ U(r)); \
+} \
+inline \
+E& operator &= (E& l, E r) \
+{ \
+ return l = l & r; \
+} \
+inline \
+E& operator |= (E& l, E r) \
+{ \
+ return l = l | r; \
+} \
+inline \
+E& operator ^= (E& l, E r) \
+{ \
+ return l = l ^ r; \
+} \
+inline \
+E operator ~ (E r) \
+{ \
+ return E(-1) ^ r; \
}
template<class E>