Function callbackFactory

Instantiates component of type T using a delegate or function.

auto auto callbackFactory(T, Args...) (
  T delegate(IAllocator, Locator!(Object,string), Args) dg,
  auto ref Args args
);

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

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

Parameters

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