4 #ifndef __CDS_DETAILS_STD_MEMORY_H
5 #define __CDS_DETAILS_STD_MEMORY_H
7 #include <cds/details/defs.h>
10 // -----------------------------------------------------------------
13 #if ((CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER == 1500) \
14 || (CDS_COMPILER == CDS_COMPILER_GCC && CDS_COMPILER_VERSION < 40400 )
15 // MS VC 2008, GCC 4.3
18 template <class T> struct default_delete {
21 void operator()(T* p) const
27 template <typename T, typename Deleter = default_delete<T> >
28 class unique_ptr: private auto_ptr<T>
30 typedef auto_ptr<T> base_class;
32 // copy ctor is deleted
33 template <typename Q, typename D> unique_ptr( unique_ptr<Q, D> const& s );
39 explicit unique_ptr( T * p ) throw()
50 T * operator ->() const throw()
52 return base_class::operator->();
55 T& operator *() throw()
57 return base_class::operator*();
60 unique_ptr& operator=( T * p )
62 base_class::operator=(p);
66 T * get() const throw()
68 return base_class::get();
73 return base_class::release();
82 base_class::reset( p );
88 // -----------------------------------------------------------------
91 #if (CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER == 1500
94 #include <boost/shared_ptr.hpp>
95 #include <boost/make_shared.hpp>
96 #include <boost/enable_shared_from_this.hpp>
99 using boost::shared_ptr;
100 using boost::make_shared;
101 using boost::allocate_shared;
102 using boost::enable_shared_from_this;
107 #endif // #ifndef __CDS_DETAILS_STD_MEMORY_H