RegistrationBag.add
void add(Reg)(auto ref Reg reg) if (is(typeof(reg.attached()) == bool) && is(typeof(reg.detach()) == bool)) @safeAdd a registration handle to this bag.
Accepts any handle type exposing attached() and detach(): Registration (from Hap, NothrowHap and the specialised variants), SharedRegistration and ScopedRegistration. Lvalues are moved from and become inert; scoped registrations are transferred (not detached), exactly as release() would. Rvalues, such as the direct result of hap.register(handler), are moved in.
This is the variant-agnostic spelling alongside hap.registerInto(bag, handler); a generic bag.register(hap, handler) cannot infer untyped lambdas.
Parameters
reg | The registration handle to add. Moved from after this call. |