Table of Contents

Method GetOrInit

Namespace
MonoMod.Utils
Assembly
MonoMod.Utils.dll

GetOrInit<T>(ref T?, Func<T>)

public static T GetOrInit<T>(ref T? location, Func<T> init) where T : class

Parameters

location T
init Func<T>

Returns

T

Type Parameters

T

GetOrInit<TParam, T>(ref T?, Func<TParam, T>, TParam)

public static T GetOrInit<TParam, T>(ref T? location, Func<TParam, T> init, TParam param) where T : class

Parameters

location T
init Func<TParam, T>
param TParam

Returns

T

Type Parameters

TParam
T

GetOrInit<T>(ref T?, delegate*<T>)

public static T GetOrInit<T>(ref T? location, delegate*<T> init) where T : class

Parameters

location T
init delegate*<T>

Returns

T

Type Parameters

T

Remarks

This overload may not work on some older Mono implementations, which do not have good function pointer support.

GetOrInit<T, TParam>(ref T?, delegate*<TParam, T>, TParam)

public static T GetOrInit<T, TParam>(ref T? location, delegate*<TParam, T> init, TParam obj) where T : class

Parameters

location T
init delegate*<TParam, T>
obj TParam

Returns

T

Type Parameters

T
TParam

Remarks

This overload may not work on some older Mono implementations, which do not have good function pointer support.