Can i create an Actor class using c++ templates?
Hello, i'm trying to define a class to hold a table of items for my inventory. I would like to be able to specify which type of items that class supports using a c++ template so i can do something like this:
I can this in pure C++, the problem is that if i want to replicate this information i can't, because this class does not derive from a Unreal Engine class like AActor. Is there a way to pull this off or i have to get rid of the c++ template and check the type at runtime? Thank you.
Not sure what your FInventoryTable is trying to achieve here, but you can have arrays of elements like this:
To answer your more general point, a UClass cannot be an instantiation of a template, nor can you have a UClass template.
answered Nov 05 '14 at 12:17 PM
Steve Robb STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here