
AMDG Zachary Turner wrote:
On Mon, Aug 10, 2009 at 10:51 AM, Steven Watanabe
wrote: This ought to return false because the types are different.
So in short, what is the flaw in just testing the way two function objects are represented internally
It would be surprising, because nothing else works that way.
I agree it might be surprising from an implementation standpoint. But are there examples of functors such that equality implemented this way would return a surprising result?
boost::lambda::_1 == std::string() The result of memcmp depends on the implementation details of std::string.
If the result isn't surprising, then I don't think the implementation should matter much, as long as it relies only on standards conformant language aspects.
memcmp is not guaranteed to produce sensible results in this context. I don't know that it is even guaranteed to work for POD types, when padding is added for alignment reasons.
Again I could just be overlooking something due to lack of understanding of the implementation details of boost::function<>, but at least on the surface it seems to me that the behavior would always produce expected results
In Christ, Steven Watanabe