Nullable<T>.Implicit(T to Nullable<T>) Nullable<T>.Implicit(T to Nullable<T>) Nullable<T>.Implicit(T to Nullable<T>) Nullable<T>.Implicit(T to Nullable<T>) Operator

Definition

Creates a new Nullable<T> object initialized to a specified value.

public:
 static operator Nullable<T>(T value);
public static implicit operator Nullable<T> (T value);
static member op_Implicit : 'T -> Nullable<'T (requires 'T : struct)>
Public Shared Widening Operator CType (value As T) As Nullable(Of T)

Parameters

value
T T T T

A value type.

Returns

A Nullable<T> object whose Value property is initialized with the value parameter.

Remarks

If the value parameter is not null, the Value property of the new Nullable<T> value is initialized to the value parameter and the HasValue property is initialized to true.

If the value parameter is null, the Value property of the new Nullable<T> value is initialized to the default value, which is the value that is all binary zeroes, and the HasValue property is initialized to false.

The equivalent method for this operator is Nullable<T>.Nullable<T>(T)

Applies to