From bc01f816c01124890e91b6c7c8b6a78f91f60963 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Fri, 9 Nov 2007 13:30:17 -0300 Subject: [PATCH] Don't do the reinterpret_cast trick anymore for type's operator|. --- eventxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eventxx b/eventxx index 7b4d950..e54d279 100644 --- a/eventxx +++ b/eventxx @@ -201,9 +201,7 @@ inline type operator| (const type& t1, const type& t2) { int r = static_cast< int >(t1) | static_cast< int >(t2); - int* pr = &r; // Avoid some weird warning about dereferencing - // type-punned pointer will break strict-aliasing rules - return *reinterpret_cast< type* >(pr); + return static_cast< type >(r); } -- 2.43.0