Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- template<typename F>
- class Test {
- private:
- F f;
- public:
- Test (F f) : f(f) {}
- template<typename... Args>
- void call (Args... a) {
- f(a...);
- }
- };
- void func (int a) {
- std::cout << a << std::endl;
- }
- int main () {
- Test<void(*)(int)> test(func);
- test.call(2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement