<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 29, 2018, at 11:08 AM, James Gregurich <<a href="mailto:bayoubengalml@mac.com" class="">bayoubengalml@mac.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Mar 28, 2018, at 4:36 PM, John McCall <<a href="mailto:rjmccall@apple.com" class="">rjmccall@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Mar 28, 2018, at 4:48 PM, James Gregurich <<a href="mailto:bayoubengalml@mac.com" class="">bayoubengalml@mac.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Mar 28, 2018, at 3:21 PM, John McCall <<a href="mailto:rjmccall@apple.com" class="">rjmccall@apple.com</a>> wrote:</div><div class=""><br class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I absolutely understand the benefits of having smart pointer types that automatically manage your retains and releases. I'm not arguing that you shoudn't use smart pointers. I don't know why you specifically want to call your smart pointers std::shared_ptr and std::weak_ptr, though, because you are just creating problems for yourself.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Why should one re-invent the wheel? the std classes work great in the non-arc mode.</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">I don't understand how. In non-ARC mode, std::shared_ptr will not retain the value it holds or release it when the shared_ptr is destroyed. It will *compile*, of course, and probably run fine in many cases because of the autorelease pool.</div></div></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">you supply a custom deallocator that calls release when appropriate.</div></div></div></div></blockquote><div><br class=""></div><div>And then you ensure that you always construct one with a retained value?</div><div><br class=""></div>This is a really-high overhead solution, both cognitively and in runtime performance, compared to just using your own smart pointer class.</div><div><br class=""></div><div>If you wanted to ask libc++ for a standard smart-pointer class for Objective-C pointer types when Objective-C is enabled, well, I don't know if they'd take it, but it seems more likely that they would take it than that they'd accept a custom partial specialization of std::shared_ptr and std::weak_ptr for Objective-C pointer types.</div><div><br class=""></div><div>John.</div></body></html>