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);
}
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 >
handler(fd, *reinterpret_cast< type* >(&ev));
}
+ private:
+ // Hide nonsense copy-constructor and operator=
+ dispatcher(const dispatcher&);
+ dispatcher& operator=(const dispatcher&);
+
}; // struct dispatcher
} // namespace eventxx