Re: [Boost-bugs] [Boost C++ Libraries] #1076: compile error: disconnecting struct with operator()() doesn't work in VS2005 SP1

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1076: compile error: disconnecting struct with operator()() doesn't work in VS2005 SP1
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-04-21 16:22:38


#1076: compile error: disconnecting struct with operator()() doesn't work in
VS2005 SP1
---------------------------------+------------------------------------------
  Reporter: boris@… | Owner: dgregor
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: signals
   Version: Boost 1.34.0 | Severity: Showstopper
Resolution: | Keywords: error
---------------------------------+------------------------------------------
Changes (by Martin Pyle <MartinNvPyle@…>):

 * cc: MartinNvPyle@… (added)
  * status: closed => reopened
  * resolution: invalid =>

Comment:

 In:
  http://lists.boost.org/boost-users/2007/07/29153.php
 Boris showed some error output. That seems to show his original problem
 with signal::disconnect was while using boost::function, not a hand
 crafted struct/functor as is shown here. I think he may have over
 simplified his example.

 I have the same problem Boris had. Using VS2005, and a boost::function
 object I get operator==() cant be found errors when calling
 signal::disconnect.
 Of course, boost::function does have an operator==().

 Here's an example:

 {{{
 #include <boost/signal.hpp>
 #include <boost/function.hpp>

 void foo()
 {
 }

 void TrySignalDisconnect()
 {
         typedef boost::function<void()> MyFunctorType;

         MyFunctorType myFunctorFoo(&foo);

         assert( &foo == myFunctorFoo ); //compiles!
         //assert( myFunctorFoo == myFunctorFoo) ); //will NOT compile

         boost::signal<void()> sig;
         sig.connect(myFunctorFoo);
         //sig.disconnect(myFunctorFoo); //will NOT compile -- same reason

 }

 }}}

 To me it looks like boost::function will compare with a raw function
 pointer, but not another boost::function ?

 I hope this isn't bending the meaning of this bug too far.
 I'm using boost 1.35.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/1076#comment:6>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC