1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
template <typename F, typename ...A> FastDelegate(F f, A... args) {
delegate = new FastDelegate6<F, A...>(f, args...);
}
template <typename O, typename ...A> FastDelegate(void(O::*f)(A...), O* object, A... args) {
delegate = new FastDelegate2<O, A...>(f, object, args...);
}
template <typename O, typename ...A> FastDelegate(void(O::*f)(A...) const, O* object, A... args) {
delegate = new FastDelegate2<O, A...>(f, object, args...);
}
template <typename O, typename D, typename ...A> FastDelegate(D* derived, A... args) {
if (static_cast<O*>(derived)) {
static_cast<FastDelegate2<O, A...>*>(delegate)->setParams(static_cast<O*>(derived), args...);
}
}
template <typename ...A> FastDelegate(void(*f)(A...), A... args) {
delegate = new FastDelegate0<A...>(f, args...);
} |
Partager