diff options
author | Jeffrey Walton <noloader@gmail.com> | 2015-07-27 16:46:25 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2015-07-27 16:46:25 -0400 |
commit | 836cf237cf2e877e1841d69ade8248a9ddc54139 (patch) | |
tree | 643e558992050362066315ff280a1b5cb18de8bd /smartptr.h | |
parent | 25cc4c2db176543952c947dc82b34a94138e441e (diff) | |
download | cryptopp-git-836cf237cf2e877e1841d69ade8248a9ddc54139.tar.gz |
Fixed compile error due to MS using _MSC_VER rather than __cplusplus
Diffstat (limited to 'smartptr.h')
-rw-r--r-- | smartptr.h | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -2,12 +2,30 @@ #define CRYPTOPP_SMARTPTR_H #include "config.h" +#include "stdcpp.h" #include "trap.h" -#include <algorithm> - NAMESPACE_BEGIN(CryptoPP) +// This must be kept in sync with stdcpp.h because <memory> is included based on the same logic. +#if ((__cplusplus >= 201103L) || (_MSC_VER >= 1600)) && !defined(__clang__) +# include <memory> + template<typename T> + using auto_ptr = std::unique_ptr<T>; +#elif defined(__clang__) +# if (__has_include(<tr1/memory>)) +# include <tr1/memory> + using std::auto_ptr; +# endif +#elif (__cplusplus < 201103L) +# include <tr1/memory> + using std::auto_ptr; +#else +# include <memory> + template<typename T> + using auto_ptr = std::unique_ptr<T>; +#endif + template <class T> class simple_ptr { public: |