System::ObjectExt::CoalesceInternal 方法

ObjectExt::CoalesceInternal method

实现对非可空类型的 ‘??’ 运算符翻译。重载用于 RT2 可转换为 RT1 的情况。

template<typename RT1,typename RT2,typename F> static std::conditional<std::is_convertible<RT2, RT1>::value, RT1, RT2>::type System::ObjectExt::CoalesceInternal(RT1 value, F func)
参数描述
T0左侧值类型。
T1封装右侧表达式的 lambda 类型。
参数类型描述
RT1左侧值。
函数F右侧表达式。

ReturnValue

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

另见