System::Nullable::NullableBoolHelper 方法

Nullable::NullableBoolHelper method

辅助函数,用于检查 this 和 other 是否均不为 null,并在满足时调用 lambda。用于实现中。

template<typename T1> bool System::Nullable<T>::NullableBoolHelper(const T1 &other, const std::function<bool()> &f, bool default_if_both_are_null=false) const
Parameter描述
T1其他可空类型。
ParameterType描述
其他const T1&用于比较的其他可空值。
fconst std::function<bool()>&如果 thisother 均非空,则调用的 lambda。
default_if_both_are_nullbool如果两个值均为 null 时返回的值。

ReturnValue

如果 thisother 任一为 null,则为 false;如果两者均为 null,则为 default_if_both_are_null;如果两者均非 null,则为 f 调用的结果。

另见