When I started learning UE c++ some time ago, I was made to believe that in order to avoid memory leaks and other bad things, I should use UPROPERTY(…) and UFUNCTION(…) so the garbage collector can do its magic and have ALL methods and properties in my classes use these macros.
I now have reason to question my knowledge. For example, Having now incorperated the Mediator design pattern into my code, I no longer expose any properties or functions to my Widgets under binding unless it goes through my Mediator class.
This is great (and super tidy), but it means all of my other classes now have only empty UPROPERTY() and UFUNCTION() macros.
I thought this was still needed for UE’s garbage collector, but when I started using TTuple and TPair, I discovered that these cannot have the UPROPERTY() macro anyway, so I guess the macros are not strictly needed for UE to run properly - Unless using TTuple and TPair is causing a memory leak?
Can someone knowledgeable please clarify if its OK to remove all the empty Macros. I am so used to seeing and using them, that I use them visually to see if a property/method is part of the child class, or lack of macro means its an overridden method, but Im wondering if removing all the unnecessary macro definitions will improve performance and efficiency of my code.