Compare()

System::Compare(const TA&, const TB&) function

Compares two values.

template<typename TA,typename TB> std::enable_if_t<!std::is_floating_point<TA>::value &&!std::is_floating_point<TB>::value, int> System::Compare(const TA &a, const TB &b)

Template parameters

ParameterDescription
TAThe type of the first comparand
TBThe type of the second comparand

Arguments

ParameterTypeDescription
aconst TA&The first comparand
bconst TB&The second comparand

Return Value

-1 if a compares less than b; 0 if the values are equal; 1 if a compares greater than b

System::Compare(const TA&, const TB&) function

Compares two floating point values.

template<typename TA,typename TB> std::enable_if_t<std::is_floating_point<TA>::value &&std::is_floating_point<TB>::value, int> System::Compare(const TA &a, const TB &b)

Template parameters

ParameterDescription
TAThe type of the first comparand
TBThe type of the second comparand

Arguments

ParameterTypeDescription
aconst TA&The first comparand
bconst TB&The second comparand

Return Value

-1 if a compares less than b; 0 if the values are equal; 1 if a compares greater than b

See Also