Boost logo

Boost :

Subject: Re: [boost] [smart_ptr] Is there any interest in unique_ptr with type erased deleter?
From: Peter Dimov (lists_at_[hidden])
Date: 2017-03-21 15:09:19


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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk