How to add new templates to UE4 reflection system?

In 4.13 release we can see added new TSet type to reflection (property) system.

So, can I create own template classes which can be used as UPROPERTies?

Now there next template types which used in reflection system: TArray, TMap, TSet, TSubclassOf. If I want create my own what I must do?

Need I change UBT\UHT for this and Core modules?

Thanks!

You would need to create UProperty class (look up engine source code to see how they are implmented) which represets the property type:

https://github.com/EpicGames/UnrealEngine/tree/55c9f3ba0010e2e483d49a4cd378f36a46601fad/Engine/Source/Runtime/CoreUObject/Private/UObject

also you need to modify UHT to make it recognize it

https://github.com/EpicGames/UnrealEngine/blob/e528f9f7fa161504dd629c3b390deac93650e43a/Engine/Source/Programs/UnrealHeaderTool/Private/UHTMakefile/UHTMakefile.cpp

and ofcorse Slate UI if you want to make it apper in property editor and you need to do the same with node pins:

https://github.com/EpicGames/UnrealEngine/tree/55c9f3ba0010e2e483d49a4cd378f36a46601fad/Engine/Source/Editor/PropertyEditor/Private/UserInterface/PropertyEditor

I never even think about doing that so this is all i can give you, it might need even deeper modifications in core so it might be painful. Note that you can create custom property UI for any type that reflection system supports for example custom UI specific structure type (good example here is FSlateBrush), so if you aim for that you don’t need to create custom property type for just that