If I have two std::function
s, how can I check whether both hold the same function or not?
Additional Information: I have a vector of functions std::vector<std::function<void()>>
and before adding another function to the vector I want to check if it already is contained.
I dont think that they both can be compared. Here is an example to explain some points on std::function comparison
Generally std::function
and boost::function
are not comparable because they need their stored object be comparable but not all function objects and also lambdas have operator==
so std
or boost
functions have no way to compare them