Are standard c++ classes garbage collected?

C++ is still normal C++ so there is no magical gurbage collection made by UE4. UE4 has GC but it only deals with stuff that it manage and only UObjects classes are garbage collected by UE4, reflection system don’t support any other pointer types so they are not get destroyed automatically as engine don’t see there existence at all. Other non-pointer data are contained in class structure so it get wiped together with object.

I also think TSharedPtr TSharedRef also might get destroyed when all references are cleared, but i not sure about it, the main use of that pointers is to prevent invalid pointers so you should use them anyway if you deal with pointers other then UObject. But i’m also not sure how it works with standard C++ types.

best will be if you manually manage those pointers from library, as you would manually use them in other non-UE4 C++ project, tied them with UObject class life circle, of object initiation create/get pointers, destroy them on object destruction.

You should also imidietly as soon as you can, convert standard C++ types to UE4 types, as UE4 code don’t digest them at all. you saying you got issue with struct, if you use standard C++ don’t use USTRUCT() so UE4 won’t have any contact with it. But by doing that oyu wont be able to use this struct in bluerint, UFUNCTION and UPROPERTY (which is also optional). you should already convert to UE4 type when you put data in to struct that will be used in UE4 code.