Opened 15 years ago

Closed 15 years ago

#1300 closed Bugs (invalid)

Comparing Boost.Function function objects doesn't work with VS2005 SP1

Reported by: boris@… Owned by: Douglas Gregor
Milestone: To Be Determined Component: function
Version: Boost 1.34.1 Severity: Problem
Keywords: Cc:

Description

Comparing Boost.Function function objects doesn't work with Visual Studio 2005 SP 1 -the compiler reports error C2666: 'boost::operator ==' : 4 overloads have similar conversions.

#include <boost/function.hpp> 

void foo() { } 
void bar() { } 

int main()
{
	boost::function<void ()> f = &foo, b = &bar; 
	f == b; 
}

I filed a bug report for Boost.Signals before (see http://svn.boost.org/trac/boost/ticket/1076). As I think it's actually a problem with Boost.Function I report it again addressing the correct library. I guess #1076 can be closed if this bug in Boost.Function is fixed.

Attachments (1)

Test.cpp (157 bytes ) - added by boris@… 15 years ago.
Test case reproducing the problem

Download all attachments as: .zip

Change History (2)

by boris@…, 15 years ago

Attachment: Test.cpp added

Test case reproducing the problem

comment:1 by Douglas Gregor, 15 years ago

Resolution: invalid
Status: newclosed

This is not a bug. One cannot compare two Boost.Function objects. The rationale is described here:

http://www.boost.org/doc/html/function/faq.html#id1215129

Note: See TracTickets for help on using tickets.