Re: [PATCH] remove auto_ptr<>



Hello,

Hubert Figuière <hub figuiere net> a écrit:

auto_ptr<> is deprecated. This patch replace it with unique_ptr<>

Thanks.  The patch looks good to me, so I am applying it to master.

I have amended it to add a "proper" ChangeLog part to the commit log, as
explained in the README.git-commit-messages.txt file in the source tree.

This is because a ChangeLog is automatically generated from the git log
when we prepare a release tarball.  So it's very helpful that the commit
log be ChangeLog friendly.

Below is the patch that was committed.  Thanks again.

Cheers,

From 170e73c3924989b0521c46754c4ae86c0e6f251c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hubert=20Figui=C3=A8re?= <hub figuiere net>
Date: Wed, 2 Nov 2016 16:54:32 +0100
Subject: [PATCH] Remove std::auto_ptr<> and replace it by std::unique_ptr<>

        * src/common/nmv-proc-utils.cc (launch_program): Replace
        deprecated auto_ptr with unique_ptr.

Signed-off-by: Dodji Seketeli <dodji seketeli org>
---
 src/common/nmv-proc-utils.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/nmv-proc-utils.cc b/src/common/nmv-proc-utils.cc
index 0d99a55..c3ca802 100644
--- a/src/common/nmv-proc-utils.cc
+++ b/src/common/nmv-proc-utils.cc
@@ -131,7 +131,7 @@ launch_program (const std::vector<UString> &a_args,
                     O_SYNC | state_flag);
         }
 
-        std::auto_ptr<char *> args;
+        std::unique_ptr<char * []> args;
         args.reset (new char* [a_args.size () + 1]);
         memset (args.get (), 0,
                 sizeof (char*) * (a_args.size () + 1));
-- 
2.10.0

-- 
                Dodji


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]