If a UObject Pointer as class property is not stored under UPROPERTY, it will be garbage collected, meaning nulled, at any time, destroying your pointer when you don’t want that to happen.
So if you get an error when you add UPROPERTY because the struct is templated, you only have the option to make a non templated struct and add UPROPERTY then.
TWeakObjectPtr is no solution because that specifically does not prevent destruction of its reference, opposite to what you want.
Weak Pointers in Unreal Engine | Unreal Engine 5.5 Documentation | Epic Developer Community
Yes but normally you create a struct to group known datatypes together as “dumb” data for a known purpose, like the details of a person (age, name, etc.) to load elsewhere, like into a class “Person”. If you create a struct with no specific purpose even a template won’t be enough to fit all use cases. If the goal is not clear, then the possibilities are simply too many.
In cases you might also just use conversion (float to string, struct to string, and back) instead of templating. This gets more common if you are writing string a lot anyway (say to read / write INI). I found this type of overlap when programming in-game setting controls, as some settings would be float (audio volume), others look like bool or enum, but were processed as string through the central system and also most of the time. I then just made a little conversion utility to get everything to string and back when required.