best practice when returning smart pointers
There is no “right” way. It really depends on the context. You can internally handle memory with a smart pointer and externally give references or raw pointers. After all, the user of your interface doesn’t need to know how you manage memory internally. In a synchronous context this is safe and efficient. In an asynchronous … Read more