void ff(int){} 
void Unscribe(const boost::function<void(int)>& f)
{
    std::map<int, boost::function<void(int)> > map;
    map[0] = ff;
    if( map[0] == f)
    {
    }  
}
Unscribe( ff ); 
I would like to be able to compare two boost::function with the same signature. What should I modified to get this code compilable ?
You can't. Read the boost function FAQ's first entry:
- Why can't I compare boost::function objects with operator== or operator!=?
 Comparison between boost::function objects cannot be implemented "well", and therefore will not be implemented. ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With