From 8d756f41c777d696f3870d8a2cf4d5570d3d1e59 Mon Sep 17 00:00:00 2001 From: anders_k Date: Mon, 30 Oct 2017 17:18:25 +0000 Subject: [PATCH] A quick hack for our outdated boost library because std::auto_ptr was deprecated in C++11 and removed in C++17 git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6946 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/boost/scoped_ptr.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/boost/scoped_ptr.hpp b/Source/boost/scoped_ptr.hpp index 836c197d..9390d396 100644 --- a/Source/boost/scoped_ptr.hpp +++ b/Source/boost/scoped_ptr.hpp @@ -19,7 +19,16 @@ #include "checked_delete.hpp" #include "detail/workaround.hpp" -#include // for std::auto_ptr +#include // for std::auto_ptr or std::unique_ptr + +// std::auto_ptr was deprecated in C++11 and removed in C++17 +namespace NSIS { namespace CXX { +#if __cplusplus >= 201103L +template struct stdsmartptr { typedef std::unique_ptr type; }; +#else +template struct stdsmartptr { typedef std::auto_ptr type; }; +#endif +}} //~ NSIS::CXX namespace boost { @@ -48,7 +57,7 @@ public: { } - explicit scoped_ptr(std::auto_ptr p): ptr(p.release()) // never throws + explicit scoped_ptr(typename NSIS::CXX::stdsmartptr::type p): ptr(p.release()) // never throws { }