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:
parent
7ccd6b3c9f
commit
8d756f41c7
1 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue