Advertisement
Guest User

Test Function C++ template

a guest
Aug 19th, 2015
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. template<typename F, typename... Args>
  4. void callFunction (F f, Args&&... args) {
  5.     f(args...);
  6. }
  7.  
  8. void some_function (int param) {
  9.     std::cout << "TEST: " << param << std::endl;
  10. }
  11.  
  12. int main () {
  13.     callFunction(some_function, 2);
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement