If you think you need it, something is probably terribly wrong with your code.
If functions take a common pointer, this should be because they must extend the lifetime of the object. If they do not need to increase the lifetime of the object, they should take the link.
With what you do, they cannot extend the life of the facility. If they need and cannot, they can terminate access to an object that has gone out of scope through a copy of the shared pointer that you passed. Boom.
Perhaps this may make sense. They may need to extend their lifespan, but you will see that the object remains in effect longer than the longest that may be required to expand it. But I still highly recommend not doing this. It is incredibly fragile and makes all the code you call depends on how the calling code behaves.
source share