RealDocs

FName::ComparisonIndex

property Core Since 4.0
#include "UObject/NameTypes.h"
Access: private

Description

Index into the global name table pointing to the case-folded version of the string, used for fast case-insensitive equality comparisons. Access via GetComparisonIndex().

Caveats & Gotchas

  • In builds without case-preserving names (WITH_CASE_PRESERVING_NAME=0, typical in shipping), ComparisonIndex and DisplayIndex are the same field — the stored entry contains a lower-cased string and there is no separate DisplayIndex member.
  • Two FNames that compare equal (operator==) always share the same ComparisonIndex regardless of their original case — this property is guaranteed and safe to rely on when building fast lookup structures.

Signature

FNameEntryId ComparisonIndex;

Example

Verify case-insensitive index equality C++
FName NameA(TEXT("MyTag"));
FName NameB(TEXT("mytag"));
// Both yield the same comparison index in all build configurations
check(NameA.GetComparisonIndex() == NameB.GetComparisonIndex());

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.