
On 03/21/17 17:53, Richard Hodges via Boost wrote:
A poly_deleter really should not hold just a function pointer as a deleter. The custom deleter may be any function, containing any amount of state (it could for example be returning resources to a memory pool, or managing a semaphore).
fixing the deleter type at `void (*)(void*)` is a no-go. It's not useful.
If you want something more generic then just use std::function as a deleter. It's been mentioned earlier in the thread. Personally though, I don't remember needing anything more elaborate than a `void (*)(void*)` function or similar. Probably because if I need something more advanced, I'll likely choose a virtual destructor or shared_ptr or intrusive_ptr. Carrying around a fat deleter in every pointer instance is what I consider a no-go.