chsvlib
chsv helper source code

◆ PMAPCOMPAREFUNC

typedef int(* PMAPCOMPAREFUNC) (const void *pLeft, std::size_t cbLeft, const void *pRight, std::size_t cbRight) NOEXCEPT_CPP17

A pointer to a compare function implementing a binary predicate over data in buffers pointed by the function parameters.

Parameters
[in]pLeftis a pointer to a buffer containing the left operand of the predicate.
[in]cbLeftis a byte length of the left operand.
[in]pRightis a pointer to a buffer containing the right operand of the predicate.
[in]cbRightis a byte length of the right operand.
Returns
If the function implements a predicate Pr(pLeft, pRight) then it must return one of the following: -negative value if and only if Pr(pLeft, pRight) == true and Pr(pRight, pLeft) == false; -positive value if and only if Pr(pLeft, pRight) == false and Pr(pRight, pLeft) == true; -zero value if and only if Pr(pLeft, pRight) == Pr(pRight, pLeft);
Remarks
The function is used as a predicate for ordering the map elements being called over their keys.
Declared in chsvmap.h.