Open sandboxFocus

Method GetValue

GetValue<T>(T)

When used to retrieve the value of a field, forces the compiler to retrieve a copy of the field value instead of an address to this field. This allows to call instance methods of value-type fields without loading the field address.

Declaration
public static T GetValue<T>(T value) where T : struct
Parameters
Type Name Description
T value

Value.

Returns
Type Description
T

value, exactly.

Type Parameters
Name Description
T

Type of the value to retrieve (this type parameter can generally be omitted).