So I’m learning C++, and curious about why some functions return pointers while others return copies. Before starting this course, I assumed functions returning anything other than simple types like float, chars, integers, etc., would return pointers to improve execution speed. So to get an actor, we get the pointer to it - that makes perfect sense to me. However, to get a transform form an actor, we get a copy of it - I figured this would be considered too expensive. What are the thoughts of you guys (and gals) who are in the know about this kind of stuff?
// GetOwner() returns a pointer, but then GetActorTransform() returns a copy
FTransform xform = GetOwner()->GetActorTransform();
-Paul