scopedRegister

fnauto scopedRegister(Args...)(ref Hap!Args hap, void delegate(Args) @safe handler) @safe

Create a scoped registration that detaches automatically at scope exit.

Parameters

hapThe hap to register the handler on.
handlerThe delegate handler to attach.

Returns

A ScopedRegistration that owns the registration.
fnauto scopedRegister(Args...)(ref Hap!Args hap, void function(Args) @safe handler) @safe

ditto

fnauto scopedRegister(Args...)(ref NothrowHap!Args hap, void delegate(Args) @safe nothrow handler) @safe nothrow

ditto

fnauto scopedRegister(Args...)(ref NothrowHap!Args hap, void function(Args) @safe nothrow handler) @safe nothrow

ditto