Boost.Function comparisons

Hi, I know this has been a big issue in the distant past and I admit to being too lazy to pore through the old discussion history, but I was reading through the proposed C++0x standard and noticed there was no equality comparison for std::function, so I went to look at Boost. There I saw that boost::function<S> has meaningful equality comparisons with objects of the type stored in the function instance, but not with function<S> itself. And that struck me as very odd. It was clearly quite intentional, since such comparisons are intentionally “poisoned” to make sure nobody uses them. So can someone explain this to me? Whatever the rationale, I think it should be available in the documentation. Thanks, -- Dave Abrahams BoostPro Computing http://www.boostpro.com

So can someone explain this to me? Whatever the rationale, I think it should be available in the documentation.
http://www.boost.org/doc/libs/1_43_0/doc/html/function/faq.html#id877916 Philippe

At Wed, 9 Jun 2010 10:10:59 +0200, Philippe Vaucher wrote:
So can someone explain this to me? Whatever the rationale, I think it should be available in the documentation.
http://www.boost.org/doc/libs/1_43_0/doc/html/function/faq.html#id877916
Perfect, thanks. -- Dave Abrahams BoostPro Computing http://www.boostpro.com

On 06/09/2010 05:26 PM, David Abrahams wrote:
At Wed, 9 Jun 2010 10:10:59 +0200, Philippe Vaucher wrote:
So can someone explain this to me? Whatever the rationale, I think it should be available in the documentation.
http://www.boost.org/doc/libs/1_43_0/doc/html/function/faq.html#id877916
Perfect, thanks.
I wonder if it's possible to support operator== returning a tribool. It should be possible to detect comparability similarly to how it's done for operator<< in boost/exception/detail/is_output_streamable.hpp.
participants (3)
-
Andrey Semashev
-
David Abrahams
-
Philippe Vaucher