So basically I want to create a set of Function objects. In python if we do:
def func():
print "a"
a = func
b = func
fset = set()
fset.insert(a)
fset.insert(b)
In this case fset will have only one function since both a and b are same in python. But in C++, if I create function objects for same function both a and b will be two different objects of a set. Is there any way that two objects of same function be same?
In C++:
void func(){
cout << "a";
}
function<void()> a = bind(func);
function<void()> b = bind(func);
Now I want if a or its pointer is already present in the set, b should not be added.