
21 Mar
2017
21 Mar
'17
3:16 p.m.
Richard Hodges wrote:
Here's a first cut of a polymorphic deleter...
It's easier to write if you wrap boost::detail::shared_count. That way you'd even be able to form weak pointers (although I'm not sure we have the necessary public interface for that.)
shared_ptr<void> works as a deleter too, this keeps us entirely within the public interface, but we'll waste a pointer. Although with it you'll be able to use make_shared inside make_poly_unique.
Although on second thought both of these break horribly after release().