You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by GitBox <gi...@apache.org> on 2020/07/23 16:15:42 UTC

[GitHub] [trafficserver] SolidWallOfCode commented on issue #5735: Replace Ptr with std::shared_ptr

SolidWallOfCode commented on issue #5735:
URL: https://github.com/apache/trafficserver/issues/5735#issuecomment-663098244


   I'm not sure we can do this. I recently ran in to a situation where `Ptr` works when `shared_ptr` would not.
   
   The essence is that, given a raw pointer, it is safe to convert it to a `Ptr` but *not* safe to convert it to a `shared_ptr`. This comes up in plugins where various objects (most commonly a `MutexPtr`) is passed across the plugin API as a raw pointer. A very specific example is assigning the `HttpSM` mutex to a per transaction `Continuation`.
   
   The C++ standard did not include Boost.IntrisuvePtr which is the equivalent of `Ptr`. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org