Question about not UPROPERTY types

Hello, I am asking to myself a question about some C++ types that are not supported by the UPROPERTY macro. In my case I want to use a TDoubleLinkedList to store values of type int32, but I know that I can’t declare it as UPROPERTY, so there are any problems if I store a TDoubleLinkedList variable type in my class without UPROPERTY macro? For example with the Garbage Collector or for some other reasons

Any opinion or help is appreciated :wink:

It would only be an issue for the garbage collector if you were placing UObject pointers (or structures that eventually contained UObject pointers) in the linked list.

But there are plenty of other side effects from participating in reflection like built-in serialization or network replication that you’ll also be giving up.

All other things being equal, it’s probably better to use a TArray for an ordered collection of ints. Unless you have memory and/or perf profiles that show that an array is a source of problems and that those problems are solved by swapping to a linked list (which I suspect you don’t have), you’re probably prematurely optimizing your problem.

1 Like

Okay so I general it is always a better way to use only objects that are supported by UPROPERTY macro. Yes I currently not have a TDoubleLinkedList variable, because before to manage with it I wanted to be sure there were not problems. Maybe I will manually create a double linked list class with UObjects or some other type of data (it is not easy because structs are a better object for the list node but they don’t support pointers on that) or manage with the TSet or TMap