Skip to content

M_CodeJam_Lazy_Create__1_3

andrewvk edited this page Jun 23, 2016 · 5 revisions

Lazy.Create(T) Method (Func(T), Boolean)

[This is preliminary documentation and is subject to change.]

Initializes a new instance of the Lazy(T) class. When lazy initialization occurs, the default constructor of the target type is used.

Namespace: CodeJam
Assembly: CodeJam (in CodeJam.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#

public static Lazy<T> Create<T>(
	Func<T> valueFactory,
	bool isThreadSafe
)

VB

Public Shared Function Create(Of T) ( 
	valueFactory As Func(Of T),
	isThreadSafe As Boolean
) As Lazy(Of T)

F#

static member Create : 
        valueFactory : Func<'T> * 
        isThreadSafe : bool -> Lazy<'T> 

Parameters

 

valueFactory
Type: System.Func(T)
The delegate that is invoked to produce the lazily initialized value when it is needed.
isThreadSafe
Type: System.Boolean
true to make this instance usable concurrently by multiple threads; false to make the instance usable by only one thread at a time.

Type Parameters

 

T
The type of object that is being lazily initialized.

Return Value

Type: Lazy(T)
New Lazy(T) instance.

See Also

Reference

Lazy Class
Create Overload
CodeJam Namespace

Clone this wiki locally