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)
Parameter描述
T0左侧值类型。
T1封装右侧表达式的 lambda 的类型。
ParameterType描述
valueRT1LHS 值。
funcFRHS 表达式。

ReturnValue

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

另见