System::ObjectExt::CoalesceInternal method

ObjectExt::CoalesceInternal method

Implementation of ‘??’ operator translation for non-nullable types. Overload for case if RT2 is convertable to 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)
ParameterDescription
T0LHS value type.
T1Type of lambda encapsulating RHS expression.
ParameterTypeDescription
valueRT1LHS value.
funcFRHS expression.

ReturnValue

If LHS value is not null, returns LHS, otherwise calculates RHS expression and returns result.

See Also