Shown below is the function and below that is version that is being generated in the .gen.cpp file. If I delete the ‘&’ out it compiles fine, but every time I make a change to this class it adds it back in and it’s driving me slightly mad.
Question: Why are you editing the .gen file? It is generated by the engine automatically adding extra optimizations.
Passing a TArray without a reference symbol & you would be making a copy of the whole array each time you would call CreateGrid.
the character list is also a const => so it is unchangeable from within the function, so any changes will not be reflected outside of the function.
So you will basically throw away the copy of the array after the function. The only way you could use it is to extract data from the characters inside the function.
Basically it’s a memory optimization added by the engine to not bloat your memory usage