C++ Logo

std-proposals

Advanced search

Re: Easier make_unique with deleter function

From: Zhihao Yuan <zy_at_[hidden]>
Date: Mon, 23 Aug 2021 17:17:54 +0000
On Monday, August 23rd, 2021 at 9:56 AM, Ville Voutilainen via Std-Proposals <std-proposals_at_[hidden]> wrote:

> On Mon, 23 Aug 2021 at 19:32, Phil Endecott via Std-Proposals
>

> >

> > I'd like to be able to write something like:
> >

> > auto tiffp = make_unique_with_deleter( TIFFOpen(fn), TIFFClose );
> >

> > Of course it can't be quite that simple.
>

> Why not? https://wandbox.org/permlink/6wZezfaxA2GDWi1o
>


I often need it :)

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
_______________________________________________

Received on 2021-08-23 12:17:58