Navigation
API > API/Runtime > API/Runtime/Core
Overloads
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int Algo::CompareMap
(
const MapType& A, |
Algo/Compare.h | ||
int Algo::CompareMap
(
const MapType& A, |
Algo/Compare.h | ||
int Algo::CompareMap
(
const MapType& A, |
Compares two unique-key maps (e.g. TMap) as if they were sorted arrays of key,value pairs sorted by Key and then by Value (almost, see note on sort order). | Algo/Compare.h |
Algo::CompareMap(const MapType &, const MapType &)
| Name | Algo::CompareMap |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Algo/Compare.h |
| Include Path | #include "Algo/Compare.h" |
namespace Algo
{
template<typename MapType>
int Algo::CompareMap
(
const MapType & A,
const MapType & B
)
}
Algo::CompareMap(const MapType &, const MapType &, KeyLessThanType)
| Name | Algo::CompareMap |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Algo/Compare.h |
| Include Path | #include "Algo/Compare.h" |
namespace Algo
{
template<typename MapType, typename KeyLessThanType>
int Algo::CompareMap
(
const MapType & A,
const MapType & B,
KeyLessThanType KeyLessThan
)
}
Algo::CompareMap(const MapType &, const MapType &, KeyLessThanType, ValueLessThanType)
Description
Compares two unique-key maps (e.g. TMap) as if they were sorted arrays of key,value pairs sorted by Key and then by Value (almost, see note on sort order). Does not support multiple values per key (e.g. TMultiMap).
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.
MapType interface: typename KeyType, typename ValueType, IntType Num(), ValueType* Find(const KeyType&), IteratorType
| Name | Algo::CompareMap |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Algo/Compare.h |
| Include Path | #include "Algo/Compare.h" |
namespace Algo
{
template<typename MapType, typename KeyLessThanType, typename ValueLessThanType>
int Algo::CompareMap
(
const MapType & A,
const MapType & B,
KeyLessThanType KeyLessThan,
ValueLessThanType ValueLessThan
)
}
-1 if A < B, 0 if A == B, 1 if A > B
Parameters
| Name | Remarks |
|---|---|
| A | Left-Hand-Side map container. |
| B | Right-Hand-Side map container. |
| KeyLessThan | bool(const KeyType& A, const KeyType& B) that returns A < B. |
| ValueLessThan | bool(const ValueType& A, const ValueType& B) that returns A < B. |