Created
February 22, 2016 14:43
-
-
Save d1ff/0ea37202601dda9be75e to your computer and use it in GitHub Desktop.
call_all
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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