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
This commit is contained in:
anders_k 2017-10-30 17:18:25 +00:00
parent 7ccd6b3c9f
commit 8d756f41c7

View file

@ -19,7 +19,16 @@
#include "checked_delete.hpp"
#include "detail/workaround.hpp"
#include <memory> // for std::auto_ptr
#include <memory> // 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<class T> struct stdsmartptr { typedef std::unique_ptr<T> type; };
#else
template<class T> struct stdsmartptr { typedef std::auto_ptr<T> type; };
#endif
}} //~ NSIS::CXX
namespace boost
{
@ -48,7 +57,7 @@ public:
{
}
explicit scoped_ptr(std::auto_ptr<T> p): ptr(p.release()) // never throws
explicit scoped_ptr(typename NSIS::CXX::stdsmartptr<T>::type p): ptr(p.release()) // never throws
{
}