#include <iostream>
#include <functional>
using namespace std;

void functionA(int a)
{
	cout << "Thanks for calling me with " << a << endl;
}

template <typename F>
void encapsulateFunction(F f, int val)
{
	std::function<void(int)> f_display = f;
	
	// f_display now points to the function encapsulated
	f_display(val);
}



int main() {
	
	encapsulateFunction(functionA, 22);
	
	return 0;
}