$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-08-18 16:33:08
Christian Larsen:
>     int main()
>     {
>         typedef function<void ()> Listener;
>
>         Listener a = listenerA;
>         Listener b = listenerB;
>
>         bool equal;
>
>         // None of these compile:
>         equal = (a == b);
>         equal = function_equal(a, b);
>         equal = a.contains(b);
>         equal = a.contains(a);
>
>         return 0;
>     }
As you've seen, 'a' contains listenerA. It's not possible to compare two 
boost::function objects for equality. Boost.Signals solves the 'remove' 
problem by returning a dedicated token from 'add' (boost::connection in its 
case) which you can then pass to 'remove'.