Boost logo

Boost Users :

From: Christian Larsen (contact_at_[hidden])
Date: 2008-08-18 13:54:07


Christian Larsen skrev:
> Hah, what a coincidence. I see that Hajo Kirchhoff has just asked
> basically the same question two hours before me.

Hm, found an answer in a previous thread:
http://lists.boost.org/boost-users/2005/05/11987.php

But then what about using contains? This doesn't compile either:

     #include <boost/function.hpp>

     using namespace boost;

     void listenerA() {}
     void listenerB() {}

     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;
     }

What to do, revert to raw function pointers?

--Christian


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net