System::Nullable::GetValueOrDefault method

Nullable::GetValueOrDefault() method

T System::Nullable<T>::GetValueOrDefault()

另见

Nullable::GetValueOrDefault(T) method

返回当前对象表示的值;如果当前对象表示的值为 null,则返回指定的值。

T System::Nullable<T>::GetValueOrDefault(T default_value)
ParameterType描述
default_valueT如果当前对象表示的值为 null 时,该方法返回的值

ReturnValue

如果当前对象表示的值不是 null,则返回该值的副本;否则返回指定的值

另见