Using references for smart pointers

Hello,

This is probably more of an C++ question than the UE4 Smart Pointer question, but nonetheless I’d greatly appreciate the assistance:

While passing SmartPtr’s and TWeakObjectPtr’s into the functions, should I pass them by ref or by value? In other words, what is the safe signature:

void  EquipItem(TSharedPtr<UEternalItem> item)
void  UsePickup(TWeakObjectPtr<UEternalPickup> pickup)

or

void  EquipItem(TSharedPtr<UEternalItem>& item)
void  UsePickup(TWeakObjectPtr<UEternalPickup>& pickup)

On one hand, passing by ref is definitely more lightweight, but is it memory-safe?

I always pass by const reference unless i need to change the value of the argument.

I’m not entirely sure about UE4 specifics but, i would assume it’s the same general rule.