Skip to content

Instantly share code, notes, and snippets.

@d1ff
Created February 22, 2016 14:43
Show Gist options
  • Save d1ff/0ea37202601dda9be75e to your computer and use it in GitHub Desktop.
Save d1ff/0ea37202601dda9be75e to your computer and use it in GitHub Desktop.
call_all
template <class T, class P, typename... Params1, typename... Params2>
static void call_all(QList<QPointer<T>> &objs, void (P::*func)(Params1...), Params2&&... parameters) {
//qDebug() << "call_all" << objs.size();
for (QPointer<T> &obj: objs) {
if (obj.isNull()) continue;
(obj->*func)(std::forward<Params2>(parameters)...);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment