Is it allowed to create template TObject : public UObject?

Is it ok if i create template with base class of UObject?
Can i still use UCLASS macro on such object, etc…?

template<class T> class TObject : public UObject {};

class UMyObject : public TObject<int> {};

Or i need to create separate TMyTemplate and UMyObject?

template<class T> class TMyTemplate {};

class UMyObject : public UObject, public TMyTemplate<int> {};

It should compile as thats nothing wrong on C++, but UE4 reflection system might not like it. I guess you can try it.

cant try it right now, i hope some one can help me, untill i will able to try it myself. thx.

As was expected, i cannot create template UObject.

So i can only create second option:

 template<class T> class TMyTemplate {};
 
 class UMyObject : public UObject, public TMyTemplate<int> {};