diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/vmime/types.hpp | 50 |
1 files changed, 8 insertions, 42 deletions
diff --git a/src/vmime/types.hpp b/src/vmime/types.hpp index 7e5b7ee8..7f2a0354 100644 --- a/src/vmime/types.hpp +++ b/src/vmime/types.hpp @@ -31,42 +31,24 @@ #include <stdexcept> #include <cstddef> #include <utility> +#include <memory> #include "vmime/config.hpp" #ifndef VMIME_BUILDING_DOC -#if VMIME_SHARED_PTR_USE_CXX - // If we are compiling with C++11, use shared_ptr<> from the standard lib - #include <memory> - - #define VMIME_SHARED_PTR_NAMESPACE std -#elif VMIME_SHARED_PTR_USE_BOOST - // Else, use boost's shared_ptr<> - #include <boost/shared_ptr.hpp> - #include <boost/weak_ptr.hpp> - #include <boost/make_shared.hpp> - #include <boost/enable_shared_from_this.hpp> - #include <boost/shared_ptr.hpp> - #include <boost/scoped_ptr.hpp> - - #define VMIME_SHARED_PTR_NAMESPACE boost -#else - #error Either VMIME_SHAREDPTR_USE_CXX or VMIME_SHAREDPTR_USE_BOOST must be set to ON -#endif - namespace vmime { - using VMIME_SHARED_PTR_NAMESPACE::shared_ptr; - using VMIME_SHARED_PTR_NAMESPACE::weak_ptr; - using VMIME_SHARED_PTR_NAMESPACE::make_shared; - using VMIME_SHARED_PTR_NAMESPACE::enable_shared_from_this; - using VMIME_SHARED_PTR_NAMESPACE::dynamic_pointer_cast; - using VMIME_SHARED_PTR_NAMESPACE::const_pointer_cast; + using std::shared_ptr; + using std::weak_ptr; + using std::make_shared; + using std::enable_shared_from_this; + using std::dynamic_pointer_cast; + using std::const_pointer_cast; /** Custom deleter to be used with shared_ptr. - * This is does not actually delete the pointer, and is used + * This does not actually delete the pointer, and is used * only for the singleton classes allocated on the stack. */ template <typename T> @@ -75,15 +57,9 @@ namespace vmime void operator()(T*) const {} }; -#if VMIME_SHARED_PTR_USE_CXX template <typename T> using scoped_ptr = std::unique_ptr <T>; -#else - using VMIME_SHARED_PTR_NAMESPACE::scoped_ptr; -#endif } -#undef VMIME_SHARED_PTR_NAMESPACE - #endif // VMIME_BUILDING_DOC @@ -103,16 +79,6 @@ namespace vmime // For compatibility with versions <= 0.7.1 (deprecated) namespace net { } namespace messaging = net; - - // For (minimal) compatibility with legacy smart pointers (<= 0.9.1) - // Your compiler must have support for C++11 -#if VMIME_COMPAT_LEGACY_SMART_POINTERS - template <typename T> using ref = shared_ptr <T>; - class creator {}; // unused - template <typename T, typename... Args> - inline shared_ptr <T> create(Args&&... args) { return make_shared <T>(args...); } -#endif - } |
