returns an object (but then the object is copied from a local variable to a function that consumes memory)
Optimal compilers may not take long to create a copy. You may also need to implement a copy constructor operator and an overload assignment operator depending on the contents of your object.
returns a pointer (but then you have do not forget to delete it, in the calling code, which is strange)
Yes, you must remember that you need to delete it, since you do not want to consider automatic cleaning for this issue.
returns a link (but this is not possible, because it will be a reference to a local variable of the function, which will be deleted as soon as the function ends)
The returned link is useful when you return this object (* this) from member functions. Otherwise, as you mentioned, it cannot be used.
Overall: it depends on your need, as described above, with respect to which one to choose.
source share