Last active
July 11, 2023 11:11
-
-
Save NTG-TPL/763dba97b85ba3c332ba39e3903789fd to your computer and use it in GitHub Desktop.
Apply the function to all arguments
This file contains 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
// The "ApplyToMany" template applies the function f (the first argument) sequentially to each of its other arguments | |
template <typename Function, typename ...Args> | |
void ApplyToMany(Function& f, Args&& ...args) { | |
((f(std::forward<Args>(args))),...); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment