Re: deducing function/delegate in template method
On Friday, 24 May 2013 at 22:37:49 UTC, Luís Marques wrote: foo.addHandlers(delegate (int x) { /* if no scope access deduction fails */ }); (I meant that deduction would fail if the literal was not marked as a delegate)
deducing function/delegate in template method
In this code: // accepts a list of handlers, for the respective types void addHandlers(T...)(T handlers) { foreach(handler; handlers) { addHandler(handler); } } // accepts one handler, for type T void addHandler(T)(void delegate (T) hand