Summary
It’s very limiting that the language does not automatically make all types comparable. This behavior disallows creating type based lookup tables. For example, a dynamic Scene Graph component could cache some lazy lookup operation with the result in order to speed up future lookup to O(1) cost.
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
# Error: 'subtype(component)' cannot be used as the type of map keys because it is not comparable for equality.
Cache: [subtype(component)]component = map {}
Expected Result
Types should be comparable.
Observed Result
Types are not comparable. A workaround using castable
implies that the code base needs to know all possible subtypes ahead of time and does not permit creation of dynamic lookup tables.
Platform(s)
UEFN (v37.10)