• Morphit @feddit.uk
    link
    fedilink
    arrow-up
    11
    ·
    6 days ago

    It’s important for objects that can be dereferenced. Smart pointers have methods that can be accessed with dot syntax like swap(). You can still dereference through a smart pointer using arrow syntax to access methods on the referenced type since they overload the operator->() method.