]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Make AutoCPtr's constructor explicit to make it more obvious when
authorOliver Kurth <okurth@vmware.com>
Tue, 5 Dec 2017 00:27:20 +0000 (16:27 -0800)
committerOliver Kurth <okurth@vmware.com>
Tue, 5 Dec 2017 00:27:20 +0000 (16:27 -0800)
pointer ownership is transferred. (This also matches std::auto_ptr.)

open-vm-tools/services/plugins/dndcp/stringxx/autoCPtr.hh

index e1f903445b0c93aa67f9d6d2ebb4527e23760776..ccb1e4057010fb7f45ae5cf5ea789674602cbcdf 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2014 VMware, Inc. All rights reserved.
+ * Copyright (C) 2014-2017 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -44,8 +44,8 @@ private:
    typedef AutoCPtr<T, FreeFunc> SelfType;
 
 public:
-   AutoCPtr(T* p = NULL,            // IN/OPT
-            FreeFunc f = std::free) // IN/OPT
+   explicit AutoCPtr(T* p = NULL,            // IN/OPT
+                     FreeFunc f = std::free) // IN/OPT
       : mP(p),
         mFree(f)
    {