← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] C++14-style std::make_unique for C++11

 

Hi John,

I have just merged your patch, thank you for your contribution.

Regards,
Orson

On 01/21/2017 05:38 PM, John Beard wrote:
> Hi,
> 
> This is a patch to add std::make_unique to common.h when the C++
> standard is C++11 (which it normally is for KiCad).
> 
> This simplifies code creating std::unique_ptr's and also means you can
> generally say "never use new". It also closes a potential for
> exception-unsafety concerning temporary "new"ed objects.
> 
> It's cribbed shamelessly from its proposal for C++14
> (https://isocpp.org/files/papers/N3656.txt), and that's more or less
> exactly how my GCC (6.3.1) implements it too. I've added the GCC
> comments in for good measure.
> 
> The idea here is that when KiCad one day moves on to C++14, this file
> can be removed entirely and forgetten!
> 
> Cheers,
> 
> John
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


Attachment: signature.asc
Description: OpenPGP digital signature


References