System::Nullable::GetValueOrDefault 方法

Nullable::GetValueOrDefault() method

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

另见

Nullable::GetValueOrDefault(T) method

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

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

ReturnValue

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

另见