- watcher *self = static_cast<watcher *>(w);
- function (*self, revents);
+ function (*static_cast<watcher *>(w), revents);
+ }
+
+ // simple callback
+ template<class K, void (K::*method)()>
+ void set (K *object)
+ {
+ set_ (object, method_noargs_thunk<K, method>);
+ }
+
+ template<class K, void (K::*method)()>
+ static void method_noargs_thunk (EV_P_ ev_watcher *w, int revents)
+ {
+ K *obj = static_cast<K *>(w->data);
+ (obj->*method) ();