This is strictly theoretical question. When project is based on smart pointers, so practically all classes use them to wrap their pointer members, is it a bad practise to pass ordinary pointers to member/not member functions? I mean, is it correct to have member functions like:
void Function(SomeClass* pSomeClass);
Or should it always be:
void Function(std::shared_ptr<SomeClass> pSomeClass);
I also wander if there are any important consequences (except standard const features) of passing const reference:
void Function(const std::shared_ptr<SomeClass>& pSomeClass)
What about situation when class is using std::unique_ptr to protect its members, and for example, pointer to its member is used in class private member function? Should it be wrapped too? Or should it be considered as design mistake?
shared_ptrfor passing to a function makes no sense. Lastly, the smart pointers are supposed to be passed (or returned) by value, otherwise their semantics doesn't really work.