System::ObjectExt::Coalesce 方法

ObjectExt::Coalesce(System::Nullable<T0>, T1) method

实现对可空类型的 ‘??’ 运算符翻译。

template<typename T0,typename T1> static T0 System::ObjectExt::Coalesce(System::Nullable<T0> value, T1 func)
参数描述
T0左侧值类型。
T1封装右侧表达式的 lambda 类型。
参数类型描述
System::Nullable<T0>左侧值。
函数T1右侧表达式。

ReturnValue

如果左侧值不为 null,则返回左侧值;否则计算右侧表达式并返回结果。

另见

ObjectExt::Coalesce(T0, T1) method

实现对非可空类型的 ‘??’ 运算符翻译。

template<typename T0,typename T1> static auto System::ObjectExt::Coalesce(T0 value, T1 func)
参数描述
T0左侧值类型。
T1封装右侧表达式的 lambda 类型。
参数类型描述
T0左侧值。
函数T1右侧表达式。

ReturnValue

如果左侧值不为 null,则返回左侧值;否则计算右侧表达式并返回结果。

另见