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; | |
} |
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
/** | |
* | |
* main() -> func() -> hello() | |
* | |
*/ | |
#include <stdio.h> | |
void hello(int x) | |
{ |
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
template<class T> | |
struct print : public unary_function<T, void> | |
{ | |
print(ostream& out) : os(out), count(0) {} | |
void operator() (T x) { os << x << ' '; ++count; } | |
ostream& os; | |
int count; | |
}; | |
int main() |