X-Git-Url: https://git.llucax.com/software/eventxx.git/blobdiff_plain/bc01f816c01124890e91b6c7c8b6a78f91f60963..9f2ee8406e40f26dc3f7d0d8ee8bd3d7a890a604:/eventxx?ds=sidebyside diff --git a/eventxx b/eventxx index e54d279..2aeb0d0 100644 --- a/eventxx +++ b/eventxx @@ -320,10 +320,7 @@ struct event: basic_event F& handler = *reinterpret_cast< F* >(h); // Hackish, but this way the handler can get a clean // event type - short* pev = &ev; // Avoid some weird warning about - // dereferencing type-punned pointer - // will break strict-aliasing rules - handler(fd, *reinterpret_cast< type* >(pev)); + handler(fd, static_cast< type >(ev)); } }; // struct event< F > @@ -794,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