Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-01-20 15:18:44


"Douglas Paul Gregor" <gregod_at_[hidden]> wrote in message
news:20040120142454.D2906_at_oberon.cs.rpi.edu...

> > Just for clarification, are you talking about managed C++ here?
>
> No. Herb requested that function<> be EqualityComparable so that he
could
> write a C++ class template with nearly the same syntax/semantics as
.NET
> delegates. For instance, one could have a delegate such that:
>
> void foo(int,int);
> void bar(int,int);
>
> delegate<void(int, int)> del;
> del += &foo;
> del += &bar;
> del -= &bar; // removes bar
> del += &foo; // ignores double-attach
>

I see now. That's nice. When I first encountered that notation for
registering event handlers, I though it was a bit strange, but I've
grown accustomed to it.

Jonathan


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