destructor - multiple declarations

Function destructor

Use delegate T for destruction of component.

auto auto destructor(Z, T, Args...) (
  Z factory,
  void delegate(IAllocator, ref T, Args) dg,
  Args args
);

Parameters

NameDescription
factory component factory which will use delegate to destroy component
dg destruction delegate
args optional arguments to delegate

Returns

factory

Function destructor

Use method of destructor to destroy component.

auto auto destructor(string method, X, Z, T, Args...) (
  Z factory,
  X destructor,
  Args args
);

auto auto destructor(string method, X, Z, T, Args...) (
  Z factory,
  Args args
);

Use method of destructor to destroy component. By convention it is assumed that first argument is destroyed compnent followed by optional arguments.

Parameters

NameDescription
method destructor's method used to destroy component
factory component factory
destructor actual destructor that will destroy object
args arguments passed to destructor

Returns

factory