[PATCH 0/2] add unique_ptr class

Martin Sebor msebor@gmail.com
Fri Aug 4 22:43:00 GMT 2017


On 07/31/2017 05:46 PM, tbsaunde+gcc@tbsaunde.org wrote:
> From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
>
> Hi,
>
> I've been saying I'd do this for a long time, but I'm finally getting to
> importing the C++98 compatable unique_ptr class Pedro wrote for gdb a while
> back.  I believe the gtl namespace also comes from Pedro, but GNU template
> library seems as reasonable as any other name I can come up with.  I'm not sure
> at the moment what outside of gcc may want to use this, but putting it include/
> at least allows us to use it in libcpp which may be useful.  I didn't include
> too much usage in this series, but I believe other people have wanted this too,
> so I'm reasonably confident it will get a fair amount of usage.
>
> patches individually bootstrapped + regtested on ppc64-linux-gnu, ok?

FWIW, I'm a big fan of RAII and I like the idea being able to
rely on a smart pointer in GCC quite a bit.  Although I haven't
reviewed the C++ 03 implementation in any detail I like how the
new API is just transitional until GCC switches from C++ 98 to
C++ 11 when it will be possible to drop it, presumably with no
changes to client code.  (If there's any risk that clients might
come to depend on the C++ 03 "features" or limitations in the
meantime and thus jeopardize this goal I would only suggest to
put some effort into making this harder.)

Other than that, thank you for this nice enhancement!

Martin



More information about the Gcc-patches mailing list