Feature request: Generics, Nested Containers, Variants, HashMap & HashSet

So, to make Blueprint a complete programming environment, the following features need to exist:

  • HashMap/Set support in Blueprint
  • Nested Containers, e.g. Array of Array (of course, the workaround is to create an array of a struct which contains a single array) - but workarounds cannot always be the solution - how about map of arrays, array of maps, etc.
  • Generics: with this, Array/Map/Set can all be made generic containers in Blueprint, and users can just select the appropriate type to actually instantiate the Generics
  • Variant: on the usage level, this provides a type erasure mechanism for containers, think of being able to create heterogeneous containers, while the user can configure the individual element variant to be a specific type; so deserializing a JSON stream into a variant struct become possible - a variant can be basic types as well as array of variant and struct (recursive), so the generic struct becomes recursive and can contain hierarchical data

Just my wish list.

After some attempt trying to implement Map support in Blueprint myself, I realized that this is not something straightforward, if not entirely impossible. an non-exhaustive list:

  • not all types are hashable (thus becoming keys), even in C++, only the types that have GetTypeHash and operator== implemented can become map keys.

  • Should the map support all kinds of types as values, then the code generation needs to take care of the type combination for Key/Value pair for all the possible value types - Array is manageable, since the code generation only needs to take care of one type at a time - I am guessing, without generics in BP, all the array types should be generated - the same would also be true for map if without generics support

  • Even if there was generics support in BP, to make hashmap working, there still needs a way for BP to specify a hash function for the type (might be a BP type) if it wants to be the map key

  • A tree based map might be easier, but there is still requirement for LessThan predicate

  • Speaking of HashSet, it feels that it might be similar to the case of Array, since the type is singular, but it still faces the hash/equal function requirements, so it’s not possible to make all types a set - on the contrary, you can make any type an array of that type (like in BP)

There has never been any official explanations regarding why such seemingly useful features are not present, I guess this at least gives some explanation.