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