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++?
asked Jul 13 '14 at 05:59 PM in C++ Programming
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.
answered Jul 14 '14 at 07:02 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here