How to build a template/generic class derived from UObject?

I am trying to build a data structure that can serve as a container for multiple objects that also inherits from UObject (so it can be managed by the garbage collector), but I getting build errors when I add the template to the class. I’ve looked at the documentation for template classes, but I can’t seem to find much help. Is there a specific way to create template classes in UE4? Is this something that I am going to have to do in raw c++?

Hi burgerbob,

UObject-derived classes need to be parsed by UnrealHeaderTool which generates reflection data for them. Unfortunately, at this point UHT does not support templated UObjects.

If GC is the only thing you want from UObject land, then you could try inheriting from FGCObject and overriding its AddReferencedObjects method to manually add any UObject references when GC runs.

Is this answer still accurate? Are templated UObjects supported now?

Nope still not supported =) we get there someday

Completely forgot to mark this as correct, but as stated, this is still the case.