summaryrefslogtreecommitdiffstats
path: root/Source/cmELF.cxx
diff options
context:
space:
mode:
authorMatthias Maennich <matthias@maennich.net>2017-09-21 21:06:05 (GMT)
committerMatthias Maennich <matthias@maennich.net>2017-09-25 22:07:19 (GMT)
commitf0489856e30b1b5236d1897071ea38dfde438fc7 (patch)
treef2a786e0c3fe5e9d234f62c3ca3cacfdbd70ef8f /Source/cmELF.cxx
parenteae3765b67b653d3f00afa44a60719a387262af8 (diff)
downloadCMake-f0489856e30b1b5236d1897071ea38dfde438fc7.zip
CMake-f0489856e30b1b5236d1897071ea38dfde438fc7.tar.gz
CMake-f0489856e30b1b5236d1897071ea38dfde438fc7.tar.bz2
Retire std::auto_ptr and its macro CM_AUTO_PTR
Signed-off-by: Matthias Maennich <matthias@maennich.net>
Diffstat (limited to 'Source/cmELF.cxx')
-rw-r--r--Source/cmELF.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 2d6d8f9..76374b2 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -2,10 +2,10 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmELF.h"
-#include "cm_auto_ptr.hxx"
#include "cm_kwiml.h"
#include "cmsys/FStream.hxx"
#include <map>
+#include <memory> // IWYU pragma: keep
#include <sstream>
#include <stddef.h>
#include <utility>
@@ -108,7 +108,7 @@ public:
};
// Construct and take ownership of the file stream object.
- cmELFInternal(cmELF* external, CM_AUTO_PTR<cmsys::ifstream>& fin,
+ cmELFInternal(cmELF* external, std::unique_ptr<cmsys::ifstream>& fin,
ByteOrderType order)
: External(external)
, Stream(*fin.release())
@@ -231,7 +231,7 @@ public:
typedef typename Types::tagtype tagtype;
// Construct with a stream and byte swap indicator.
- cmELFInternalImpl(cmELF* external, CM_AUTO_PTR<cmsys::ifstream>& fin,
+ cmELFInternalImpl(cmELF* external, std::unique_ptr<cmsys::ifstream>& fin,
ByteOrderType order);
// Return the number of sections as specified by the ELF header.
@@ -424,9 +424,8 @@ private:
};
template <class Types>
-cmELFInternalImpl<Types>::cmELFInternalImpl(cmELF* external,
- CM_AUTO_PTR<cmsys::ifstream>& fin,
- ByteOrderType order)
+cmELFInternalImpl<Types>::cmELFInternalImpl(
+ cmELF* external, std::unique_ptr<cmsys::ifstream>& fin, ByteOrderType order)
: cmELFInternal(external, fin, order)
{
// Read the main header.
@@ -682,7 +681,7 @@ cmELF::cmELF(const char* fname)
: Internal(nullptr)
{
// Try to open the file.
- CM_AUTO_PTR<cmsys::ifstream> fin(new cmsys::ifstream(fname));
+ std::unique_ptr<cmsys::ifstream> fin(new cmsys::ifstream(fname));
// Quit now if the file could not be opened.
if (!fin.get() || !*fin) {