Boost logo

Boost :

Subject: Re: [boost] [RFC] unique_val (handles, IDs, descriptors...)
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2018-02-15 16:21:14


2018-02-14 23:48 GMT+01:00 Miguel Ojeda via Boost <boost_at_[hidden]>:

> On Wed, Feb 14, 2018 at 11:06 PM, Brook Milligan <brook_at_[hidden]> wrote:
> >
> >> On Feb 14, 2018, at 2:18 PM, Miguel Ojeda via Boost <
> boost_at_[hidden]> wrote:
> >>
> >> If you have the time, please take a look (specially to the Rationale)
> >> and let me know your comments. The code itself is very short and
> >> straightforward.
> >
> > A quick look suggests that this is useful.
>
> Thanks as well for the very quick review!
>
> >
> > However, why not have the unique_val class _be_ the RAII class?
> Couldn't this be done with extra template arguments (or just one) giving
> construction/destruction policies? You have perfect forwarding so
> constructor arguments can be forwarded to the policy. Would this not give
> you the Foo class for free? Just wondering.
>
> I thought about that as a possible extension, but since I typically
> need/want to write other things (operations, logging...) in the RAII
> class, I wrote that way.

I actually find it a convincing argument. Now I can see why you would want
to have only `unique_value`.

Regards,
&rzej;


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