Created
May 14, 2013 06:07
-
-
Save thlgood/5574022 to your computer and use it in GitHub Desktop.
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
#include <iostream> | |
using namespace std; | |
template<typename T> | |
struct hello | |
{ | |
void operator()(T& x) | |
{ | |
cout << "What the F_CK:" << x << endl; | |
} | |
}; | |
template<typename T, typename T1> | |
void func(T& x, T1& f) | |
{ | |
f(x); | |
} | |
int main(void) | |
{ | |
int param = 10; | |
func(param, hello<int>()); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
include
using namespace std;
template
struct hello
{
void operator()(T& x)
{
cout << "What the F_CK:" << x << endl;
}
};
template<typename T, typename T1>
void func(T& x, T1& f)
{
f(x);
}
int main(void)
{
int param = 10;
hello func_inst;
func(param, func_inst);
return 0;
}