Function callbackFactory

Instantiates data of type T using a delegate or function.

auto auto callbackFactory(T, Args...) (
  Locator!() locator,
  T delegate(Locator!(), Args) dg,
  auto ref Args args
);

auto auto callbackFactory(T, Args...) (
  Locator!() locator,
  T function(Locator!(), Args) dg,
  auto ref Args args
);

Encapsulates data's construction logic using a delegate. The algorithm uses a delegate to create required data, with a set of Args that are passed to delegate, and a locator for dependency fetching.

Parameters

NameDescription
T the constructed aggregate
Args type tuple of arguments passed to delegate for aggregate's construction.