Closed purplesyringa closed 4 years ago
I think it's possible actually. Supporting all types of deleters can be tricky though while constraining the signature to something more specific may be easier to implement and work with.
I've to try it though, so let's see. What do you suggest exactly? Is having a void(*)(char *)
like deleter enough from your point of view?
See if branch experimental
is what you expect. Thanks.
I'm looking forward to your feedback.
Yes, it solves my problem. Thanks!
Consider an external C function that allocates memory with
malloc
. I want to send the data over a TCP socket, butTCPHandle::write
only acceptsunique_ptr<char[], default_delete<char[]>>
. Can passing a custom deleter be implemented?