Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Algo > API/Runtime/Core/Algo/Algo__CompareSet
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/Algo/Compare.h |
| Include | #include "Algo/Compare.h" |
namespace Algo
{
template<typename SetType, typename KeyLessThanType>
int Algo::CompareSet
(
const SetType & A,
const SetType & B,
KeyLessThanType KeyLessThan
)
}
Remarks
Compares two sets (e.g. TSet) as if they were sorted arrays of keys (almost, see note on sort order).
Note on sort order: Maps with a smaller number of elements are considered less than maps with a larger number of elements, no matter what keys are present in each map. This drastically improves performance when comparing maps of different sizes. This is different than would be exepcted from a lexical compare of strings, but it does match the comparison of two numbers represented as a string of digits.
SetType interface: typename ElementType IntType Num(), bool Contains(const KeyType&), IteratorType
Parameters
| Name | Description |
|---|---|
| A | Left-Hand-Side set container. |
| B | Right-Hand-Side set container. |
| KeyLessThan | bool(const KeyType& A, const KeyType& B) that returns A < B. |