How can I compare two C++11 std::function
s with operator==
, and return true
if both of said function
s refer to the same f
Be aware that equality of functions (deciding if two functions have always the same observable behavior) is an undecidable problem in lambda calculus (and that is why many programming languages forbid comparing functions).
So even if the ==
test compiles, it would at most just test that the code is identical (has the same address), not that the compared functions have the same behaviour.