X-Git-Url: https://git.llucax.com/software/eventxx.git/blobdiff_plain/2be5a2e8f3eb90f2f6da62c0fd81c7e3b3e62f0c..ab96e110f2d5754fc1d9822db3506d58a0929122:/eventxx diff --git a/eventxx b/eventxx index 9ac878d..2aeb0d0 100644 --- a/eventxx +++ b/eventxx @@ -201,7 +201,7 @@ inline type operator| (const type& t1, const type& t2) { int r = static_cast< int >(t1) | static_cast< int >(t2); - return *reinterpret_cast< type* >(&r); + return static_cast< type >(r); } @@ -320,7 +320,7 @@ struct event: basic_event F& handler = *reinterpret_cast< F* >(h); // Hackish, but this way the handler can get a clean // event type - handler(fd, *reinterpret_cast< type* >(&ev)); + handler(fd, static_cast< type >(ev)); } }; // struct event< F > @@ -791,6 +791,11 @@ struct dispatcher handler(fd, *reinterpret_cast< type* >(&ev)); } + private: + // Hide nonsense copy-constructor and operator= + dispatcher(const dispatcher&); + dispatcher& operator=(const dispatcher&); + }; // struct dispatcher } // namespace eventxx