diff options
author | Brad King <brad.king@kitware.com> | 2019-06-25 11:13:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-06-25 11:13:38 (GMT) |
commit | dba8086f58484f545c053a3c5175ec75df8a817f (patch) | |
tree | 87132d27e3759c50f6684f0676b3a29d1c4f492b /Source/cmMachO.cxx | |
parent | 92351fe7cd73a756effd5a42ff7f04c2d9beaf88 (diff) | |
parent | 5e52de7d5708c5d2faf00837bf5f10ed024cced1 (diff) | |
download | CMake-dba8086f58484f545c053a3c5175ec75df8a817f.zip CMake-dba8086f58484f545c053a3c5175ec75df8a817f.tar.gz CMake-dba8086f58484f545c053a3c5175ec75df8a817f.tar.bz2 |
Merge topic 'refactor/use-unique_ptr'
5e52de7d57 modermize: replace some raw pointers w/ `unique_ptr`
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3465
Diffstat (limited to 'Source/cmMachO.cxx')
-rw-r--r-- | Source/cmMachO.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx index d4af1e0..ac6dce9 100644 --- a/Source/cmMachO.cxx +++ b/Source/cmMachO.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMachO.h" +#include "cmAlgorithms.h" #include "cmsys/FStream.hxx" -#include <algorithm> -#include <stddef.h> +#include <cstddef> #include <string> #include <vector> @@ -120,7 +120,7 @@ protected: // Implementation for reading Mach-O header and load commands. // This is 32 or 64 bit arch specific. -template <class T> +template <typename T> class cmMachOHeaderAndLoadCommandsImpl : public cmMachOHeaderAndLoadCommands { public: @@ -306,15 +306,11 @@ bool cmMachOInternal::read_mach_o(uint32_t file_offset) // External class implementation. cmMachO::cmMachO(const char* fname) - : Internal(nullptr) + : Internal(cm::make_unique<cmMachOInternal>(fname)) { - this->Internal = new cmMachOInternal(fname); } -cmMachO::~cmMachO() -{ - delete this->Internal; -} +cmMachO::~cmMachO() = default; std::string const& cmMachO::GetErrorMessage() const { |