Created
February 15, 2019 03:14
-
-
Save cppio/fb53c5c4ceb1a636acc29ed4677ba222 to your computer and use it in GitHub Desktop.
An example of C++ perfect forwarding
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
#include <utility> | |
template<typename F, typename... Args> | |
decltype(auto) call(F&& f, Args&&... args) { return f(std::forward<Args>(args)...); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment