If you do not want to own the memory (in this case you must pass either shared_ptr or unique_ptr ), why do you work with a pointer at all?
Follow this link.
void helperFunc(MyClass& obj) {
Using source pointers when you donβt want to take ownership is, in general, but not necessary at all, unless you explicitly want to allow nullptr (in this case, yes, use a raw pointer).
source share