According to the web site, shared_ptr isn't yet supported. It only (mis-leadingly, IMO) says that these types can be used as value types (which is not useful for types designed with shared_ptr and particularly weak_ptr in mind, and only useful for legacy types — just like in Swift, types usually aren't used both on stack and on heap).
I can also create a shared_ptr and call methods like reset() on the shared_ptr, but there is no way to actually get at the pointed-to object to call methods on it.
But I can't find any more info on what the road map for shared_ptr is? Can anyone point me to more information about future plans? I can't seem to find the magic combination of words to search for.
You should be able to use mySharedPtr.pointee to retrieve the wrapped object. std::shared_ptr defines an T& operator*() const which is mapped to var pointee: T in Swift.
Thank you, that seems to work for non-mutating methods. Seems .pointee is immutable though, so I can only call const methods. I don't suppose there's a .mutablePointee or so?