Lazy<T>.Create(TFunc,Boolean) Constructor

Initializes a new instance of the Lazy<T> record. When lazy initialization occurs, the specified initialization function is used.

Namespace: Spring
public
 constructor Create(const valueFactory: TFunc<T>; ownsObject: Boolean = False); overload;

Parameters

valueFactory
Type: TFunc<T>

The delegate that is invoked to produce the lazily initialized value when it is needed.

ownsObject
Type: Boolean

If true the value - if any got created - will be destroyed when going out of scope. Only when T is a class type.