On 2011-09-22 23:08, bearophile wrote:
Andrei Alexandrescu:

A function literal should be comparable to another for equality.

Are you willing to explain me why, and show an use case?

Bye,
bearophile

When using lambdas as event handlers:

class Foo
{
    event[] events;

    void registerEventHandler (void delegate (event) dg)
    {
        if (!events.contains(dg)) // register a given just delegate once
            events ~= dg;
    }
}



--
/Jacob Carlborg

Reply via email to