Boost logo

Boost :

Subject: Re: [boost] boost::interprocess::unique_ptr vs Boost.SmartPtr
From: Eric Niebler (eniebler_at_[hidden])
Date: 2013-03-07 17:16:21


On 13-03-07 01:06 PM, Adam Romanek wrote:
> Hi!
>
> If I'm correct then the first "serious" implementation of unique_ptr for
> C++03 was written by Howard Hinnant, which was later adopted to
> Boost.Interprocess library.
>
> Unfortunately, I suppose not many people are aware of the fact that
> unique_ptr for C++03 is available in Boost. Even worse, I know people
> who are aware of it but who are afraid of using it just because it is
> provided by Boost.Interprocess, not by Boost.SmartPtr.
>
> Therefore, here's my proposal:
> - boost::interprocess::unique_ptr could be pulled into the top-level
> boost namespace
> - Boost.SmartPtr could provide a header file for unique_ptr that would
> pull the implementation from Boost.Interprocess; such a header file
> could also be placed in the top-level boost directory so that it could
> be accessed more easily
> - boost::unique_ptr could be documented in the documentation for
> Boost.SmartPtr library, providing use cases, emulation limitations etc.
>
> I believe that would make unique_ptr for C++03 available to wider audience.
>
> What do you think about this idea?

I think if the unique_ptr in interprocess doesn't depend on the rest of
interprocess, or can be easily made stand-alone, then it should just be
moved into smart_ptr. I don't want the smart_ptr library to depend on
interprocess. That would be weird. Interprocess can then #include
unique_ptr and import it into its namespace with a using directive for
back compat.

-- 
Eric Niebler
Boost.org

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