Skip to content

Instantly share code, notes, and snippets.

@1995hnagamin
Created June 20, 2016 09:07
Show Gist options
  • Save 1995hnagamin/27bb9182b7f06064257a03170a0cd2bd to your computer and use it in GitHub Desktop.
Save 1995hnagamin/27bb9182b7f06064257a03170a0cd2bd to your computer and use it in GitHub Desktop.
#include <functional>
#include <iostream>
template<typename T, typename... U>
using Fn = std::function<T(U...)>;
int add(int x, int y) {
return x + y;
}
int main() {
Fn<int,int,int> plus = add;
std::cout << plus(1,2) << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment