diff --git a/include/matador/utils/cascade_type.hpp b/include/matador/utils/cascade_type.hpp index a102499..47bd64a 100644 --- a/include/matador/utils/cascade_type.hpp +++ b/include/matador/utils/cascade_type.hpp @@ -15,13 +15,13 @@ enum class cascade_type ALL = REMOVE | UPDATE | INSERT /**< Cascade type all */ }; -inline cascade_type operator~ (cascade_type a) { return (cascade_type)~(int)a; } -inline cascade_type operator| (cascade_type a, cascade_type b) { return (cascade_type)((int)a | (int)b); } -inline cascade_type operator& (cascade_type a, cascade_type b) { return (cascade_type)((int)a & (int)b); } -inline cascade_type operator^ (cascade_type a, cascade_type b) { return (cascade_type)((int)a ^ (int)b); } -inline cascade_type& operator|= (cascade_type& a, cascade_type b) { return (cascade_type&)((int&)a |= (int)b); } -inline cascade_type& operator&= (cascade_type& a, cascade_type b) { return (cascade_type&)((int&)a &= (int)b); } -inline cascade_type& operator^= (cascade_type& a, cascade_type b) { return (cascade_type&)((int&)a ^= (int)b); } +inline cascade_type operator~ (cascade_type a) { return static_cast(~static_cast(a)); } +inline cascade_type operator| (cascade_type a, cascade_type b) { return static_cast(static_cast(a) | static_cast(b)); } +inline cascade_type operator& (cascade_type a, cascade_type b) { return static_cast(static_cast(a) & static_cast(b)); } +inline cascade_type operator^ (cascade_type a, cascade_type b) { return static_cast(static_cast(a) ^ static_cast(b)); } +inline cascade_type& operator|= (cascade_type& a, cascade_type b) { return reinterpret_cast(reinterpret_cast(a) |= static_cast(b)); } +inline cascade_type& operator&= (cascade_type& a, cascade_type b) { return reinterpret_cast(reinterpret_cast(a) &= static_cast(b)); } +inline cascade_type& operator^= (cascade_type& a, cascade_type b) { return reinterpret_cast(reinterpret_cast(a) ^= static_cast(b)); } } #endif //OOS_CASCADE_TYPE_HPP