System::ObjectExt::Coalesce method

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

Implementation of ‘??’ operator translation for nullable types.

template<typename T0,typename T1> static T0 System::ObjectExt::Coalesce(System::Nullable<T0> value, T1 func)
ParameterDescription
T0LHS value type.
T1Type of lambda encapsulating RHS expression.
ParameterTypeDescription
valueSystem::Nullable<T0>LHS value.
funcT1RHS expression.

ReturnValue

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

See Also

ObjectExt::Coalesce(T0, T1) method

Implementation of ‘??’ operator translation for non-nullable types.

template<typename T0,typename T1> static auto System::ObjectExt::Coalesce(T0 value, T1 func)
ParameterDescription
T0LHS value type.
T1Type of lambda encapsulating RHS expression.
ParameterTypeDescription
valueT0LHS value.
funcT1RHS expression.

ReturnValue

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

See Also