Boost logo

Boost :

From: Brian McNamara (lorgon_at_[hidden])
Date: 2004-03-11 13:29:15


On Thu, Mar 11, 2004 at 05:35:38PM +0200, Peter Dimov wrote:
> Yes, I understand the Long-Term Goal (if not its utmost importance), but
> your approach doesn't scale to other function<>-like entites.
>
> void f();
> my_function<void()> g(f);
> your_function<void()> h(g);
>
> g == h; //???
> g.contains(h); // false
> h.contains(g); // true
>
> It's limited to the one and only function<> (and you can't even ask a
> function<> whether it contains another function<>, right?)

I am also curious about how cases like

   void f(int,int,int);
   function<void(int,int)> tmp1 = bind(&f,5,_1,_2);
   function<void(int,int)> tmp2 = bind(&f,_1,_2,7);
   bind(tmp1,_1,7) == bind(tmp2,5,_1) // ?

(ought to) work. (If my intent isn't clear above, I am trying to bind
the first and third arguments of f() in two different ways. Presumably
the LHS and RHS of the operator== on the last line have different
types, despite the fact that they "are the same function", for some
definition of sameness.)

-- 
-Brian McNamara (lorgon_at_[hidden])

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk