mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-14 23:07:48 -04:00
use unique_ptr instead of auto_ptr - note that this modifies boost, which isn't a big deal since it is part of the repo, but we should really decouple the open source libs sometime
This commit is contained in:
@@ -83,7 +83,7 @@ private:
|
||||
MxCifBinTree * m_left; // left child
|
||||
MxCifBinTree * m_right; // right child
|
||||
|
||||
// @todo: use an auto_ptr here?
|
||||
// @todo: use an unique_ptr here?
|
||||
std::vector<const MxCifQuadTreeBounds *> m_objects; // objects that are contained in our bounds
|
||||
};
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
template <typename Function>
|
||||
wince_thread(Function f, unsigned int = 0)
|
||||
{
|
||||
std::auto_ptr<func_base> arg(new func<Function>(f));
|
||||
std::unique_ptr<func_base> arg(new func<Function>(f));
|
||||
DWORD thread_id = 0;
|
||||
thread_ = ::CreateThread(0, 0, wince_thread_function,
|
||||
arg.get(), 0, &thread_id);
|
||||
@@ -101,7 +101,7 @@ private:
|
||||
|
||||
inline DWORD WINAPI wince_thread_function(LPVOID arg)
|
||||
{
|
||||
std::auto_ptr<wince_thread::func_base> func(
|
||||
std::unique_ptr<wince_thread::func_base> func(
|
||||
static_cast<wince_thread::func_base*>(arg));
|
||||
func->run();
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ namespace detail {
|
||||
* be allowed to finish normally, the work object may be explicitly destroyed.
|
||||
*
|
||||
* @code boost::asio::io_service io_service;
|
||||
* auto_ptr<boost::asio::io_service::work> work(
|
||||
* unique_ptr<boost::asio::io_service::work> work(
|
||||
* new boost::asio::io_service::work(io_service));
|
||||
* ...
|
||||
* work.reset(); // Allow run() to exit. @endcode
|
||||
|
||||
+3
-3
@@ -101,7 +101,7 @@ private:
|
||||
Handler handler_;
|
||||
void handler_impl(const boost::system::error_code& error, size_t size)
|
||||
{
|
||||
std::auto_ptr<io_handler<Stream, Handler> > this_ptr(this);
|
||||
std::unique_ptr<io_handler<Stream, Handler> > this_ptr(this);
|
||||
handler_(error, size);
|
||||
}
|
||||
}; // class io_handler
|
||||
@@ -125,7 +125,7 @@ private:
|
||||
Handler handler_;
|
||||
void handler_impl(const boost::system::error_code& error, size_t)
|
||||
{
|
||||
std::auto_ptr<handshake_handler<Stream, Handler> > this_ptr(this);
|
||||
std::unique_ptr<handshake_handler<Stream, Handler> > this_ptr(this);
|
||||
handler_(error);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ private:
|
||||
Handler handler_;
|
||||
void handler_impl(const boost::system::error_code& error, size_t)
|
||||
{
|
||||
std::auto_ptr<shutdown_handler<Stream, Handler> > this_ptr(this);
|
||||
std::unique_ptr<shutdown_handler<Stream, Handler> > this_ptr(this);
|
||||
handler_(error);
|
||||
}
|
||||
}; // class shutdown_handler
|
||||
|
||||
+4
-4
@@ -47,7 +47,7 @@ namespace assign_detail
|
||||
{
|
||||
protected:
|
||||
typedef boost::ptr_vector<T> impl_type;
|
||||
typedef std::auto_ptr<impl_type> release_type;
|
||||
typedef std::unique_ptr<impl_type> release_type;
|
||||
mutable impl_type values_;
|
||||
|
||||
public:
|
||||
@@ -92,9 +92,9 @@ namespace assign_detail
|
||||
}
|
||||
|
||||
template< class PtrContainer >
|
||||
std::auto_ptr<PtrContainer> convert( const PtrContainer* c ) const
|
||||
std::unique_ptr<PtrContainer> convert( const PtrContainer* c ) const
|
||||
{
|
||||
std::auto_ptr<PtrContainer> res( new PtrContainer() );
|
||||
std::unique_ptr<PtrContainer> res( new PtrContainer() );
|
||||
while( !empty() )
|
||||
res->insert( res->end(),
|
||||
values_.pop_back().release() );
|
||||
@@ -102,7 +102,7 @@ namespace assign_detail
|
||||
}
|
||||
|
||||
template< class PtrContainer >
|
||||
std::auto_ptr<PtrContainer> to_container( const PtrContainer& c ) const
|
||||
std::unique_ptr<PtrContainer> to_container( const PtrContainer& c ) const
|
||||
{
|
||||
return convert( &c );
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
#endif
|
||||
|
||||
//
|
||||
// Prior to version 2.0, std::auto_ptr was buggy, and there were no
|
||||
// Prior to version 2.0, std::unique_ptr was buggy, and there were no
|
||||
// new-style iostreams, and no conformant std::allocator:
|
||||
//
|
||||
#if (BOOST_RWSTD_VER < 0x020000)
|
||||
|
||||
@@ -290,7 +290,7 @@ namespace gregorian {
|
||||
* names as a default. */
|
||||
catch(std::bad_cast&){
|
||||
charT a = '\0';
|
||||
std::auto_ptr< const facet_def > f(create_facet_def(a));
|
||||
std::unique_ptr< const facet_def > f(create_facet_def(a));
|
||||
num = date_time::find_match(f->get_short_month_names(),
|
||||
f->get_long_month_names(),
|
||||
(greg_month::max)(), s); // greg_month spans 1..12, so max returns the array size,
|
||||
@@ -332,7 +332,7 @@ namespace gregorian {
|
||||
* names as a default. */
|
||||
catch(std::bad_cast&){
|
||||
charT a = '\0';
|
||||
std::auto_ptr< const facet_def > f(create_facet_def(a));
|
||||
std::unique_ptr< const facet_def > f(create_facet_def(a));
|
||||
num = date_time::find_match(f->get_short_weekday_names(),
|
||||
f->get_long_weekday_names(),
|
||||
(greg_weekday::max)() + 1, s); // greg_weekday spans 0..6, so increment is needed
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
|
||||
extern "C" void * lw_thread_routine( void * pv )
|
||||
{
|
||||
std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
|
||||
std::unique_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
|
||||
|
||||
pt->run();
|
||||
|
||||
@@ -88,7 +88,7 @@ extern "C" void * lw_thread_routine( void * pv )
|
||||
|
||||
unsigned __stdcall lw_thread_routine( void * pv )
|
||||
{
|
||||
std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
|
||||
std::unique_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
|
||||
|
||||
pt->run();
|
||||
|
||||
@@ -117,7 +117,7 @@ private:
|
||||
|
||||
template<class F> int lw_thread_create( pthread_t & pt, F f )
|
||||
{
|
||||
std::auto_ptr<lw_abstract_thread> p( new lw_thread_impl<F>( f ) );
|
||||
std::unique_ptr<lw_abstract_thread> p( new lw_thread_impl<F>( f ) );
|
||||
|
||||
int r = pthread_create( &pt, 0, lw_thread_routine, p.get() );
|
||||
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
// we make sure that our include of <memory> doesn't try to
|
||||
// pull in the TR1 headers: that's why we use this header
|
||||
// rather than including <memory> directly:
|
||||
#include <boost/config/no_tr1/memory.hpp> // std::auto_ptr
|
||||
#include <boost/config/no_tr1/memory.hpp> // std::unique_ptr
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -24,7 +24,7 @@ template<class T> T * get_pointer(T * p)
|
||||
|
||||
// get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
|
||||
|
||||
template<class T> T * get_pointer(std::auto_ptr<T> const& p)
|
||||
template<class T> T * get_pointer(std::unique_ptr<T> const& p)
|
||||
{
|
||||
return p.get();
|
||||
}
|
||||
|
||||
@@ -281,9 +281,9 @@ namespace boost {
|
||||
protected:
|
||||
// Holding the property by-value causes edge-descriptor
|
||||
// invalidation for add_edge() with EdgeList=vecS. Instead we
|
||||
// hold a pointer to the property. std::auto_ptr is not
|
||||
// hold a pointer to the property. std::unique_ptr is not
|
||||
// a perfect fit for the job, but it is darn close.
|
||||
std::auto_ptr<Property> m_property;
|
||||
std::unique_ptr<Property> m_property;
|
||||
};
|
||||
#else
|
||||
template <class Vertex, class Property>
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@
|
||||
#include <functional> // unary_function.
|
||||
#include <iterator> // advance.
|
||||
#include <list>
|
||||
#include <memory> // allocator, auto_ptr.
|
||||
#include <memory> // allocator, unique_ptr.
|
||||
#include <typeinfo>
|
||||
#include <stdexcept> // logic_error, out_of_range.
|
||||
#include <boost/checked_delete.hpp>
|
||||
@@ -253,7 +253,7 @@ private:
|
||||
pback_size != -1 ?
|
||||
pback_size :
|
||||
pimpl_->pback_size_;
|
||||
std::auto_ptr<streambuf_t>
|
||||
std::unique_ptr<streambuf_t>
|
||||
buf(new streambuf_t(t, buffer_size, pback_size));
|
||||
list().push_back(buf.get());
|
||||
buf.release();
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <memory> // allocator, auto_ptr.
|
||||
#include <memory> // allocator, unique_ptr.
|
||||
#include <boost/config.hpp> // BOOST_DEDUCED_TYPENAME.
|
||||
#include <boost/iostreams/char_traits.hpp>
|
||||
#include <boost/iostreams/constants.hpp> // buffer size.
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ namespace boost {
|
||||
|
||||
std::ios_base &ios_;
|
||||
struct data;
|
||||
std::auto_ptr<data> d;
|
||||
std::unique_ptr<data> d;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -220,7 +220,7 @@ namespace boost {
|
||||
void operator=(generator const &);
|
||||
|
||||
struct data;
|
||||
std::auto_ptr<data> d;
|
||||
std::unique_ptr<data> d;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
namespace boost {
|
||||
namespace locale {
|
||||
///
|
||||
/// \brief a smart pointer similar to std::auto_ptr but it is non-copyable and the
|
||||
/// \brief a smart pointer similar to std::unique_ptr but it is non-copyable and the
|
||||
/// underlying object has the same constness as the pointer itself (unlike an ordinary pointer).
|
||||
///
|
||||
template<typename T>
|
||||
|
||||
@@ -104,14 +104,14 @@ namespace boost {
|
||||
///
|
||||
/// Create new localization backend according to current settings.
|
||||
///
|
||||
std::auto_ptr<localization_backend> get() const;
|
||||
std::unique_ptr<localization_backend> get() const;
|
||||
|
||||
///
|
||||
/// Add new backend to the manager, each backend should be uniquely defined by its name.
|
||||
///
|
||||
/// This library provides: "icu", "posix", "winapi" and "std" backends.
|
||||
///
|
||||
void add_backend(std::string const &name,std::auto_ptr<localization_backend> backend);
|
||||
void add_backend(std::string const &name,std::unique_ptr<localization_backend> backend);
|
||||
|
||||
///
|
||||
/// Clear backend
|
||||
@@ -143,7 +143,7 @@ namespace boost {
|
||||
static localization_backend_manager global();
|
||||
private:
|
||||
class impl;
|
||||
std::auto_ptr<impl> pimpl_;
|
||||
std::unique_ptr<impl> pimpl_;
|
||||
};
|
||||
|
||||
} // locale
|
||||
|
||||
+4
-4
@@ -176,15 +176,15 @@ namespace util {
|
||||
/// This function creates a \a base_converter that can be used for conversion between UTF-8 and
|
||||
/// unicode code points
|
||||
///
|
||||
BOOST_LOCALE_DECL std::auto_ptr<base_converter> create_utf8_converter();
|
||||
BOOST_LOCALE_DECL std::unique_ptr<base_converter> create_utf8_converter();
|
||||
///
|
||||
/// This function creates a \a base_converter that can be used for conversion between single byte
|
||||
/// character encodings like ISO-8859-1, koi8-r, windows-1255 and Unicode code points,
|
||||
///
|
||||
/// If \a encoding is not supported, empty pointer is returned. You should check if
|
||||
/// std::auto_ptr<base_converter>::get() != 0
|
||||
/// std::unique_ptr<base_converter>::get() != 0
|
||||
///
|
||||
BOOST_LOCALE_DECL std::auto_ptr<base_converter> create_simple_converter(std::string const &encoding);
|
||||
BOOST_LOCALE_DECL std::unique_ptr<base_converter> create_simple_converter(std::string const &encoding);
|
||||
|
||||
|
||||
///
|
||||
@@ -199,7 +199,7 @@ namespace util {
|
||||
/// of wide encoding type
|
||||
///
|
||||
BOOST_LOCALE_DECL
|
||||
std::locale create_codecvt(std::locale const &in,std::auto_ptr<base_converter> cvt,character_facet_type type);
|
||||
std::locale create_codecvt(std::locale const &in,std::unique_ptr<base_converter> cvt,character_facet_type type);
|
||||
|
||||
} // util
|
||||
} // locale
|
||||
|
||||
@@ -441,7 +441,7 @@ load_impl(Archiver& ar, boost::python::object& obj,
|
||||
int len;
|
||||
ar >> len;
|
||||
|
||||
std::auto_ptr<char> string(new char[len]);
|
||||
std::unique_ptr<char> string(new char[len]);
|
||||
ar >> boost::serialization::make_array(string.get(), len);
|
||||
boost::python::str py_string(string.get(), len);
|
||||
obj = boost::python::pickle::loads(py_string);
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace detail{
|
||||
* pointer to T we mean a type P such that, given a p of Type P
|
||||
* *...n...*x is convertible to T&, for some n>=1.
|
||||
* Examples of chained pointers are raw and smart pointers, iterators and
|
||||
* arbitrary combinations of these (vg. T** or auto_ptr<T*>.)
|
||||
* arbitrary combinations of these (vg. T** or unique_ptr<T*>.)
|
||||
*/
|
||||
|
||||
template<class Value,typename Type,Type (*PtrToFunction)(Value)>
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace detail{
|
||||
* mean a type P such that, given a p of type P
|
||||
* *...n...*x is convertible to Type&, for some n>=1.
|
||||
* Examples of chained pointers are raw and smart pointers, iterators and
|
||||
* arbitrary combinations of these (vg. Type** or auto_ptr<Type*>.)
|
||||
* arbitrary combinations of these (vg. Type** or unique_ptr<Type*>.)
|
||||
*/
|
||||
|
||||
template<typename Type>
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace multi_index{
|
||||
* to T we mean a type P such that, given a p of Type P
|
||||
* *...n...*x is convertible to T&, for some n>=1.
|
||||
* Examples of chained pointers are raw and smart pointers, iterators and
|
||||
* arbitrary combinations of these (vg. T** or auto_ptr<T*>.)
|
||||
* arbitrary combinations of these (vg. T** or unique_ptr<T*>.)
|
||||
*/
|
||||
|
||||
template<class Class,typename Type,Type (Class::*PtrToMemberFunction)()const>
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ namespace detail{
|
||||
* a type P such that, given a p of Type P
|
||||
* *...n...*x is convertible to T&, for some n>=1.
|
||||
* Examples of chained pointers are raw and smart pointers, iterators and
|
||||
* arbitrary combinations of these (vg. T** or auto_ptr<T*>.)
|
||||
* arbitrary combinations of these (vg. T** or unique_ptr<T*>.)
|
||||
*/
|
||||
|
||||
template<class Class,typename Type,Type Class::*PtrToMember>
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace program_options {
|
||||
|
||||
/** Initializes the object with the passed data.
|
||||
|
||||
Note: it would be nice to make the second parameter auto_ptr,
|
||||
Note: it would be nice to make the second parameter unique_ptr,
|
||||
to explicitly pass ownership. Unfortunately, it's often needed to
|
||||
create objects of types derived from 'value_semantic':
|
||||
options_description d;
|
||||
@@ -59,7 +59,7 @@ namespace program_options {
|
||||
Here, the static type returned by 'parameter' should be derived
|
||||
from value_semantic.
|
||||
|
||||
Alas, derived->base conversion for auto_ptr does not really work,
|
||||
Alas, derived->base conversion for unique_ptr does not really work,
|
||||
see
|
||||
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2000/n1232.pdf
|
||||
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#84
|
||||
|
||||
+2
-2
@@ -104,7 +104,7 @@ namespace ptr_container_detail
|
||||
{ }
|
||||
|
||||
template< class PtrContainer >
|
||||
explicit associative_ptr_container( std::auto_ptr<PtrContainer> r )
|
||||
explicit associative_ptr_container( std::unique_ptr<PtrContainer> r )
|
||||
: base_type( r )
|
||||
{ }
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace ptr_container_detail
|
||||
{ }
|
||||
|
||||
template< class PtrContainer >
|
||||
associative_ptr_container& operator=( std::auto_ptr<PtrContainer> r ) // nothrow
|
||||
associative_ptr_container& operator=( std::unique_ptr<PtrContainer> r ) // nothrow
|
||||
{
|
||||
base_type::operator=( r );
|
||||
return *this;
|
||||
|
||||
+11
-11
@@ -338,7 +338,7 @@ namespace ptr_container_detail
|
||||
{ }
|
||||
|
||||
template< class PtrContainer >
|
||||
explicit reversible_ptr_container( std::auto_ptr<PtrContainer> clone )
|
||||
explicit reversible_ptr_container( std::unique_ptr<PtrContainer> clone )
|
||||
{
|
||||
swap( *clone );
|
||||
}
|
||||
@@ -355,7 +355,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class PtrContainer >
|
||||
reversible_ptr_container& operator=( std::auto_ptr<PtrContainer> clone ) // nothrow
|
||||
reversible_ptr_container& operator=( std::unique_ptr<PtrContainer> clone ) // nothrow
|
||||
{
|
||||
swap( *clone );
|
||||
return *this;
|
||||
@@ -569,7 +569,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
iterator insert( iterator before, std::auto_ptr<U> x )
|
||||
iterator insert( iterator before, std::unique_ptr<U> x )
|
||||
{
|
||||
return insert( before, x.release() );
|
||||
}
|
||||
@@ -633,7 +633,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
auto_type replace( iterator where, std::auto_ptr<U> x )
|
||||
auto_type replace( iterator where, std::unique_ptr<U> x )
|
||||
{
|
||||
return replace( where, x.release() );
|
||||
}
|
||||
@@ -653,7 +653,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
auto_type replace( size_type idx, std::auto_ptr<U> x )
|
||||
auto_type replace( size_type idx, std::unique_ptr<U> x )
|
||||
{
|
||||
return replace( idx, x.release() );
|
||||
}
|
||||
@@ -678,26 +678,26 @@ namespace ptr_container_detail
|
||||
// is buggy on most compilers, so we use a macro instead
|
||||
//
|
||||
#define BOOST_PTR_CONTAINER_DEFINE_RELEASE_AND_CLONE( PC, base_type, this_type ) \
|
||||
explicit PC( std::auto_ptr<this_type> r ) \
|
||||
explicit PC( std::unique_ptr<this_type> r ) \
|
||||
: base_type ( r ) { } \
|
||||
\
|
||||
PC& operator=( std::auto_ptr<this_type> r ) \
|
||||
PC& operator=( std::unique_ptr<this_type> r ) \
|
||||
{ \
|
||||
base_type::operator=( r ); \
|
||||
return *this; \
|
||||
} \
|
||||
\
|
||||
std::auto_ptr<this_type> release() \
|
||||
std::unique_ptr<this_type> release() \
|
||||
{ \
|
||||
std::auto_ptr<this_type> ptr( new this_type );\
|
||||
std::unique_ptr<this_type> ptr( new this_type );\
|
||||
this->swap( *ptr ); \
|
||||
return ptr; \
|
||||
} \
|
||||
BOOST_PTR_CONTAINER_DEFINE_RELEASE( base_type ) \
|
||||
\
|
||||
std::auto_ptr<this_type> clone() const \
|
||||
std::unique_ptr<this_type> clone() const \
|
||||
{ \
|
||||
return std::auto_ptr<this_type>( new this_type( this->begin(), this->end() ) ); \
|
||||
return std::unique_ptr<this_type>( new this_type( this->begin(), this->end() ) ); \
|
||||
}
|
||||
|
||||
#define BOOST_PTR_CONTAINER_DEFINE_COPY_CONSTRUCTORS( PC, base_type ) \
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace boost
|
||||
static_cast<const T*>( &r[i] ) );
|
||||
}
|
||||
|
||||
explicit ptr_array( std::auto_ptr<this_type> r )
|
||||
explicit ptr_array( std::unique_ptr<this_type> r )
|
||||
: base_class( r ) { }
|
||||
|
||||
ptr_array& operator=( ptr_array r )
|
||||
@@ -109,22 +109,22 @@ namespace boost
|
||||
return *this;
|
||||
}
|
||||
|
||||
ptr_array& operator=( std::auto_ptr<this_type> r )
|
||||
ptr_array& operator=( std::unique_ptr<this_type> r )
|
||||
{
|
||||
base_class::operator=(r);
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::auto_ptr<this_type> release()
|
||||
std::unique_ptr<this_type> release()
|
||||
{
|
||||
std::auto_ptr<this_type> ptr( new this_type );
|
||||
std::unique_ptr<this_type> ptr( new this_type );
|
||||
this->swap( *ptr );
|
||||
return ptr;
|
||||
}
|
||||
|
||||
std::auto_ptr<this_type> clone() const
|
||||
std::unique_ptr<this_type> clone() const
|
||||
{
|
||||
std::auto_ptr<this_type> pa( new this_type );
|
||||
std::unique_ptr<this_type> pa( new this_type );
|
||||
for( size_t i = 0; i != N; ++i )
|
||||
{
|
||||
if( ! is_null(i) )
|
||||
@@ -158,7 +158,7 @@ namespace boost
|
||||
}
|
||||
|
||||
template< size_t idx, class V >
|
||||
auto_type replace( std::auto_ptr<V> r )
|
||||
auto_type replace( std::unique_ptr<V> r )
|
||||
{
|
||||
return replace<idx>( r.release() );
|
||||
}
|
||||
@@ -178,7 +178,7 @@ namespace boost
|
||||
}
|
||||
|
||||
template< class V >
|
||||
auto_type replace( size_t idx, std::auto_ptr<V> r )
|
||||
auto_type replace( size_t idx, std::unique_ptr<V> r )
|
||||
{
|
||||
return replace( idx, r.release() );
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ namespace boost
|
||||
}
|
||||
|
||||
template< class U >
|
||||
void push_back( std::auto_ptr<U> ptr ) // nothrow
|
||||
void push_back( std::unique_ptr<U> ptr ) // nothrow
|
||||
{
|
||||
push_back( ptr.release() );
|
||||
}
|
||||
@@ -311,7 +311,7 @@ namespace boost
|
||||
}
|
||||
|
||||
template< class U >
|
||||
void push_front( std::auto_ptr<U> ptr ) // nothrow
|
||||
void push_front( std::unique_ptr<U> ptr ) // nothrow
|
||||
{
|
||||
push_front( ptr.release() );
|
||||
}
|
||||
@@ -335,7 +335,7 @@ namespace boost
|
||||
}
|
||||
|
||||
template< class U >
|
||||
iterator insert( iterator pos, std::auto_ptr<U> ptr ) // nothrow
|
||||
iterator insert( iterator pos, std::unique_ptr<U> ptr ) // nothrow
|
||||
{
|
||||
return insert( pos, ptr.release() );
|
||||
}
|
||||
@@ -378,7 +378,7 @@ namespace boost
|
||||
}
|
||||
|
||||
template< class U >
|
||||
iterator rinsert( iterator pos, std::auto_ptr<U> ptr ) // nothrow
|
||||
iterator rinsert( iterator pos, std::unique_ptr<U> ptr ) // nothrow
|
||||
{
|
||||
return rinsert( pos, ptr.release() );
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace ptr_container
|
||||
|
||||
template< class T >
|
||||
ptr_back_insert_iterator&
|
||||
operator=( std::auto_ptr<T> r )
|
||||
operator=( std::unique_ptr<T> r )
|
||||
{
|
||||
container->push_back( r );
|
||||
return *this;
|
||||
@@ -135,7 +135,7 @@ namespace ptr_container
|
||||
|
||||
template< class T >
|
||||
ptr_front_insert_iterator&
|
||||
operator=( std::auto_ptr<T> r )
|
||||
operator=( std::unique_ptr<T> r )
|
||||
{
|
||||
container->push_front( r );
|
||||
return *this;
|
||||
@@ -196,7 +196,7 @@ namespace ptr_container
|
||||
|
||||
template< class T >
|
||||
ptr_insert_iterator&
|
||||
operator=( std::auto_ptr<T> r )
|
||||
operator=( std::unique_ptr<T> r )
|
||||
{
|
||||
iter = container->insert( iter, r );
|
||||
return *this;
|
||||
|
||||
@@ -262,12 +262,12 @@ namespace ptr_container_detail
|
||||
{ }
|
||||
|
||||
template< class PtrContainer >
|
||||
explicit ptr_map_adapter_base( std::auto_ptr<PtrContainer> clone )
|
||||
explicit ptr_map_adapter_base( std::unique_ptr<PtrContainer> clone )
|
||||
: base_type( clone )
|
||||
{ }
|
||||
|
||||
template< typename PtrContainer >
|
||||
ptr_map_adapter_base& operator=( std::auto_ptr<PtrContainer> clone )
|
||||
ptr_map_adapter_base& operator=( std::unique_ptr<PtrContainer> clone )
|
||||
{
|
||||
base_type::operator=( clone );
|
||||
return *this;
|
||||
@@ -358,7 +358,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
auto_type replace( iterator where, std::auto_ptr<U> x )
|
||||
auto_type replace( iterator where, std::unique_ptr<U> x )
|
||||
{
|
||||
return replace( where, x.release() );
|
||||
}
|
||||
@@ -488,7 +488,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
ptr_map_adapter( std::auto_ptr<U> r ) : base_type( r )
|
||||
ptr_map_adapter( std::unique_ptr<U> r ) : base_type( r )
|
||||
{ }
|
||||
|
||||
ptr_map_adapter& operator=( ptr_map_adapter r )
|
||||
@@ -498,7 +498,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
ptr_map_adapter& operator=( std::auto_ptr<U> r )
|
||||
ptr_map_adapter& operator=( std::unique_ptr<U> r )
|
||||
{
|
||||
base_type::operator=( r );
|
||||
return *this;
|
||||
@@ -551,7 +551,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
std::pair<iterator,bool> insert( const key_type& key, std::auto_ptr<U> x )
|
||||
std::pair<iterator,bool> insert( const key_type& key, std::unique_ptr<U> x )
|
||||
{
|
||||
return insert_impl( key, x.release() );
|
||||
}
|
||||
@@ -578,7 +578,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
iterator insert( iterator before, const key_type& key, std::auto_ptr<U> x ) // strong
|
||||
iterator insert( iterator before, const key_type& key, std::unique_ptr<U> x ) // strong
|
||||
{
|
||||
return insert_impl( before, key, x.release() );
|
||||
}
|
||||
@@ -737,7 +737,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
explicit ptr_multimap_adapter( std::auto_ptr<U> r ) : base_type( r )
|
||||
explicit ptr_multimap_adapter( std::unique_ptr<U> r ) : base_type( r )
|
||||
{ }
|
||||
|
||||
ptr_multimap_adapter& operator=( ptr_multimap_adapter r )
|
||||
@@ -747,7 +747,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
ptr_multimap_adapter& operator=( std::auto_ptr<U> r )
|
||||
ptr_multimap_adapter& operator=( std::unique_ptr<U> r )
|
||||
{
|
||||
base_type::operator=( r );
|
||||
return *this;
|
||||
@@ -800,7 +800,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
iterator insert( const key_type& key, std::auto_ptr<U> x )
|
||||
iterator insert( const key_type& key, std::unique_ptr<U> x )
|
||||
{
|
||||
return insert_impl( key, x.release() );
|
||||
}
|
||||
@@ -821,7 +821,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
iterator insert( iterator before, const key_type& key, std::auto_ptr<U> x ) // strong
|
||||
iterator insert( iterator before, const key_type& key, std::unique_ptr<U> x ) // strong
|
||||
{
|
||||
return insert_impl( before, key, x.release() );
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace ptr_container_detail
|
||||
{ }
|
||||
|
||||
template< class PtrContainer >
|
||||
explicit ptr_sequence_adapter( std::auto_ptr<PtrContainer> clone )
|
||||
explicit ptr_sequence_adapter( std::unique_ptr<PtrContainer> clone )
|
||||
: base_type( clone )
|
||||
{ }
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class PtrContainer >
|
||||
ptr_sequence_adapter& operator=( std::auto_ptr<PtrContainer> clone )
|
||||
ptr_sequence_adapter& operator=( std::unique_ptr<PtrContainer> clone )
|
||||
{
|
||||
base_type::operator=( clone );
|
||||
return *this;
|
||||
@@ -251,7 +251,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
void push_back( std::auto_ptr<U> x )
|
||||
void push_back( std::unique_ptr<U> x )
|
||||
{
|
||||
push_back( x.release() );
|
||||
}
|
||||
@@ -266,7 +266,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
void push_front( std::auto_ptr<U> x )
|
||||
void push_front( std::unique_ptr<U> x )
|
||||
{
|
||||
push_front( x.release() );
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace ptr_container_detail
|
||||
{ }
|
||||
|
||||
template< class PtrContainer >
|
||||
explicit ptr_set_adapter_base( std::auto_ptr<PtrContainer> clone )
|
||||
explicit ptr_set_adapter_base( std::unique_ptr<PtrContainer> clone )
|
||||
: base_type( clone )
|
||||
{ }
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< typename PtrContainer >
|
||||
ptr_set_adapter_base& operator=( std::auto_ptr<PtrContainer> clone )
|
||||
ptr_set_adapter_base& operator=( std::unique_ptr<PtrContainer> clone )
|
||||
{
|
||||
base_type::operator=( clone );
|
||||
return *this;
|
||||
@@ -386,7 +386,7 @@ namespace ptr_container_detail
|
||||
{ }
|
||||
|
||||
template< class PtrContainer >
|
||||
explicit ptr_set_adapter( std::auto_ptr<PtrContainer> clone )
|
||||
explicit ptr_set_adapter( std::unique_ptr<PtrContainer> clone )
|
||||
: base_type( clone )
|
||||
{ }
|
||||
|
||||
@@ -398,7 +398,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class T >
|
||||
void operator=( std::auto_ptr<T> r )
|
||||
void operator=( std::unique_ptr<T> r )
|
||||
{
|
||||
base_type::operator=( r );
|
||||
}
|
||||
@@ -416,7 +416,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
std::pair<iterator,bool> insert( std::auto_ptr<U> x )
|
||||
std::pair<iterator,bool> insert( std::unique_ptr<U> x )
|
||||
{
|
||||
return insert( x.release() );
|
||||
}
|
||||
@@ -435,7 +435,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
iterator insert( iterator where, std::auto_ptr<U> x )
|
||||
iterator insert( iterator where, std::unique_ptr<U> x )
|
||||
{
|
||||
return insert( where, x.release() );
|
||||
}
|
||||
@@ -586,7 +586,7 @@ namespace ptr_container_detail
|
||||
{ }
|
||||
|
||||
template< class PtrContainer >
|
||||
explicit ptr_multiset_adapter( std::auto_ptr<PtrContainer> clone )
|
||||
explicit ptr_multiset_adapter( std::unique_ptr<PtrContainer> clone )
|
||||
: base_type( clone )
|
||||
{ }
|
||||
|
||||
@@ -598,7 +598,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class T >
|
||||
void operator=( std::auto_ptr<T> r )
|
||||
void operator=( std::unique_ptr<T> r )
|
||||
{
|
||||
base_type::operator=( r );
|
||||
}
|
||||
@@ -609,7 +609,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
iterator insert( iterator before, std::auto_ptr<U> x )
|
||||
iterator insert( iterator before, std::unique_ptr<U> x )
|
||||
{
|
||||
return insert( before, x.release() );
|
||||
}
|
||||
@@ -626,7 +626,7 @@ namespace ptr_container_detail
|
||||
}
|
||||
|
||||
template< class U >
|
||||
iterator insert( std::auto_ptr<U> x )
|
||||
iterator insert( std::unique_ptr<U> x )
|
||||
{
|
||||
return insert( x.release() );
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ struct arg_rvalue_from_python
|
||||
typedef typename boost::add_reference<
|
||||
T
|
||||
// We can't add_const here, or it would be impossible to pass
|
||||
// auto_ptr<U> args from Python to C++
|
||||
// unique_ptr<U> args from Python to C++
|
||||
>::type result_type;
|
||||
|
||||
arg_rvalue_from_python(PyObject*);
|
||||
|
||||
+3
-3
@@ -27,15 +27,15 @@ struct as_to_python_function
|
||||
convert_function_must_take_value_or_const_reference(&ToPython::convert, 1L);
|
||||
|
||||
// Yes, the const_cast below opens a hole in const-correctness,
|
||||
// but it's needed to convert auto_ptr<U> to python.
|
||||
// but it's needed to convert unique_ptr<U> to python.
|
||||
//
|
||||
// How big a hole is it? It allows ToPython::convert() to be
|
||||
// a function which modifies its argument. The upshot is that
|
||||
// client converters applied to const objects may invoke
|
||||
// undefined behavior. The damage, however, is limited by the
|
||||
// use of the assertion function. Thus, the only way this can
|
||||
// modify its argument is if T is an auto_ptr-like type. There
|
||||
// is still a const-correctness hole w.r.t. auto_ptr<U> const,
|
||||
// modify its argument is if T is an unique_ptr-like type. There
|
||||
// is still a const-correctness hole w.r.t. unique_ptr<U> const,
|
||||
// but c'est la vie.
|
||||
return ToPython::convert(*const_cast<T*>(static_cast<T const*>(x)));
|
||||
}
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
#ifndef COPY_CTOR_MUTATES_RHS_DWA2003219_HPP
|
||||
# define COPY_CTOR_MUTATES_RHS_DWA2003219_HPP
|
||||
|
||||
#include <boost/python/detail/is_auto_ptr.hpp>
|
||||
#include <boost/python/detail/is_unique_ptr.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace python { namespace detail {
|
||||
|
||||
template <class T>
|
||||
struct copy_ctor_mutates_rhs
|
||||
: is_auto_ptr<T>
|
||||
: is_unique_ptr<T>
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
@@ -14,12 +14,12 @@ namespace boost { namespace python { namespace detail {
|
||||
|
||||
# if !defined(BOOST_NO_AUTO_PTR)
|
||||
|
||||
BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1)
|
||||
BOOST_PYTHON_IS_XXX_DEF(unique_ptr, std::unique_ptr, 1)
|
||||
|
||||
# else
|
||||
|
||||
template <class T>
|
||||
struct is_auto_ptr : mpl::false_
|
||||
struct is_unique_ptr : mpl::false_
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace detail
|
||||
template <class U>
|
||||
void dispatch(U* x, mpl::true_) const
|
||||
{
|
||||
std::auto_ptr<U> owner(x);
|
||||
std::unique_ptr<U> owner(x);
|
||||
dispatch(owner, mpl::false_());
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ struct py_function
|
||||
}
|
||||
|
||||
private:
|
||||
mutable std::auto_ptr<py_function_impl_base> m_impl;
|
||||
mutable std::unique_ptr<py_function_impl_base> m_impl;
|
||||
};
|
||||
|
||||
}}} // namespace boost::python::objects
|
||||
|
||||
@@ -81,13 +81,13 @@ namespace detail
|
||||
template <class T>
|
||||
static PyObject* execute(T* p)
|
||||
{
|
||||
// can't use auto_ptr with Intel 5 and VC6 Dinkum library
|
||||
// for some reason. We get link errors against the auto_ptr
|
||||
// can't use unique_ptr with Intel 5 and VC6 Dinkum library
|
||||
// for some reason. We get link errors against the unique_ptr
|
||||
// copy constructor.
|
||||
# if defined(__ICL) && __ICL < 600
|
||||
typedef boost::shared_ptr<T> smart_pointer;
|
||||
# else
|
||||
typedef std::auto_ptr<T> smart_pointer;
|
||||
typedef std::unique_ptr<T> smart_pointer;
|
||||
# endif
|
||||
typedef objects::pointer_holder<smart_pointer, T> holder_t;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <boost/detail/quick_allocator.hpp>
|
||||
#endif
|
||||
|
||||
#include <memory> // std::auto_ptr, std::allocator
|
||||
#include <memory> // std::unique_ptr, std::allocator
|
||||
#include <functional> // std::less
|
||||
#include <exception> // std::exception
|
||||
#include <new> // std::bad_alloc
|
||||
@@ -365,10 +365,10 @@ public:
|
||||
|
||||
#ifndef BOOST_NO_AUTO_PTR
|
||||
|
||||
// auto_ptr<Y> is special cased to provide the strong guarantee
|
||||
// unique_ptr<Y> is special cased to provide the strong guarantee
|
||||
|
||||
template<class Y>
|
||||
explicit shared_count(std::auto_ptr<Y> & r): pi_(
|
||||
explicit shared_count(std::unique_ptr<Y> & r): pi_(
|
||||
new sp_counted_base_impl<
|
||||
Y *,
|
||||
boost::checked_deleter<Y>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <boost/serialization/access.hpp>
|
||||
#include <boost/serialization/detail/shared_count_132.hpp>
|
||||
|
||||
#include <memory> // for std::auto_ptr
|
||||
#include <memory> // for std::unique_ptr
|
||||
#include <algorithm> // for std::swap
|
||||
#include <functional> // for std::less
|
||||
#include <typeinfo> // for std::bad_cast
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
#ifndef BOOST_NO_AUTO_PTR
|
||||
|
||||
template<class Y>
|
||||
explicit shared_ptr(std::auto_ptr<Y> & r): px(r.get()), pn()
|
||||
explicit shared_ptr(std::unique_ptr<Y> & r): px(r.get()), pn()
|
||||
{
|
||||
Y * tmp = r.get();
|
||||
pn = detail::shared_count(r);
|
||||
@@ -223,7 +223,7 @@ public:
|
||||
#ifndef BOOST_NO_AUTO_PTR
|
||||
|
||||
template<class Y>
|
||||
shared_ptr & operator=(std::auto_ptr<Y> & r)
|
||||
shared_ptr & operator=(std::unique_ptr<Y> & r)
|
||||
{
|
||||
this_type(r).swap(*this);
|
||||
return *this;
|
||||
|
||||
+3
-3
@@ -20,7 +20,7 @@
|
||||
#include <boost/detail/atomic_count.hpp>
|
||||
|
||||
#ifndef BOOST_NO_AUTO_PTR
|
||||
# include <memory> // for std::auto_ptr
|
||||
# include <memory> // for std::unique_ptr
|
||||
#endif
|
||||
|
||||
#include <algorithm> // for std::swap
|
||||
@@ -91,13 +91,13 @@ public:
|
||||
|
||||
#ifndef BOOST_NO_AUTO_PTR
|
||||
|
||||
explicit shared_ptr(std::auto_ptr< T > & r)
|
||||
explicit shared_ptr(std::unique_ptr< T > & r)
|
||||
{
|
||||
pn = new count_type(1); // may throw
|
||||
px = r.release(); // fix: moved here to stop leak if new throws
|
||||
}
|
||||
|
||||
shared_ptr & operator=(std::auto_ptr< T > & r)
|
||||
shared_ptr & operator=(std::unique_ptr< T > & r)
|
||||
{
|
||||
shared_ptr(r).swap(*this);
|
||||
return *this;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
// we make sure that our include of <memory> doesn't try to
|
||||
// pull in the TR1 headers: that's why we use this header
|
||||
// rather than including <memory> directly:
|
||||
#include <boost/config/no_tr1/memory.hpp> // std::auto_ptr
|
||||
#include <boost/config/no_tr1/memory.hpp> // std::unique_ptr
|
||||
#include <functional> // std::less
|
||||
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
@@ -389,10 +389,10 @@ public:
|
||||
|
||||
#ifndef BOOST_NO_AUTO_PTR
|
||||
|
||||
// auto_ptr<Y> is special cased to provide the strong guarantee
|
||||
// unique_ptr<Y> is special cased to provide the strong guarantee
|
||||
|
||||
template<class Y>
|
||||
explicit shared_count( std::auto_ptr<Y> & r ): pi_( new sp_counted_impl_p<Y>( r.get() ) )
|
||||
explicit shared_count( std::unique_ptr<Y> & r ): pi_( new sp_counted_impl_p<Y>( r.get() ) )
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
, id_(shared_count_id)
|
||||
#endif
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#ifndef BOOST_NO_AUTO_PTR
|
||||
# include <memory> // for std::auto_ptr
|
||||
# include <memory> // for std::unique_ptr
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
@@ -36,7 +36,7 @@ void sp_scalar_destructor_hook(void * p);
|
||||
// scoped_ptr mimics a built-in pointer except that it guarantees deletion
|
||||
// of the object pointed to, either on destruction of the scoped_ptr or via
|
||||
// an explicit reset(). scoped_ptr is a simple solution for simple needs;
|
||||
// use shared_ptr or std::auto_ptr if your needs are more complex.
|
||||
// use shared_ptr or std::unique_ptr if your needs are more complex.
|
||||
|
||||
template<class T> class scoped_ptr // noncopyable
|
||||
{
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
|
||||
#ifndef BOOST_NO_AUTO_PTR
|
||||
|
||||
explicit scoped_ptr( std::auto_ptr<T> p ) BOOST_NOEXCEPT : px( p.release() )
|
||||
explicit scoped_ptr( std::unique_ptr<T> p ) BOOST_NOEXCEPT : px( p.release() )
|
||||
{
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
boost::sp_scalar_constructor_hook( px );
|
||||
|
||||
+11
-11
@@ -20,7 +20,7 @@
|
||||
// we make sure that our include of <memory> doesn't try to
|
||||
// pull in the TR1 headers: that's why we use this header
|
||||
// rather than including <memory> directly:
|
||||
#include <boost/config/no_tr1/memory.hpp> // std::auto_ptr
|
||||
#include <boost/config/no_tr1/memory.hpp> // std::unique_ptr
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/checked_delete.hpp>
|
||||
@@ -233,13 +233,13 @@ inline void sp_enable_shared_from_this( ... )
|
||||
|
||||
#if !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( BOOST_NO_AUTO_PTR )
|
||||
|
||||
// rvalue auto_ptr support based on a technique by Dave Abrahams
|
||||
// rvalue unique_ptr support based on a technique by Dave Abrahams
|
||||
|
||||
template< class T, class R > struct sp_enable_if_auto_ptr
|
||||
template< class T, class R > struct sp_enable_if_unique_ptr
|
||||
{
|
||||
};
|
||||
|
||||
template< class T, class R > struct sp_enable_if_auto_ptr< std::auto_ptr< T >, R >
|
||||
template< class T, class R > struct sp_enable_if_unique_ptr< std::unique_ptr< T >, R >
|
||||
{
|
||||
typedef R type;
|
||||
};
|
||||
@@ -438,7 +438,7 @@ public:
|
||||
#ifndef BOOST_NO_AUTO_PTR
|
||||
|
||||
template<class Y>
|
||||
explicit shared_ptr( std::auto_ptr<Y> & r ): px(r.get()), pn()
|
||||
explicit shared_ptr( std::unique_ptr<Y> & r ): px(r.get()), pn()
|
||||
{
|
||||
boost::detail::sp_assert_convertible< Y, T >();
|
||||
|
||||
@@ -451,7 +451,7 @@ public:
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
template<class Y>
|
||||
shared_ptr( std::auto_ptr<Y> && r ): px(r.get()), pn()
|
||||
shared_ptr( std::unique_ptr<Y> && r ): px(r.get()), pn()
|
||||
{
|
||||
boost::detail::sp_assert_convertible< Y, T >();
|
||||
|
||||
@@ -464,7 +464,7 @@ public:
|
||||
#elif !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
|
||||
template<class Ap>
|
||||
explicit shared_ptr( Ap r, typename boost::detail::sp_enable_if_auto_ptr<Ap, int>::type = 0 ): px( r.get() ), pn()
|
||||
explicit shared_ptr( Ap r, typename boost::detail::sp_enable_if_unique_ptr<Ap, int>::type = 0 ): px( r.get() ), pn()
|
||||
{
|
||||
typedef typename Ap::element_type Y;
|
||||
|
||||
@@ -517,7 +517,7 @@ public:
|
||||
#ifndef BOOST_NO_AUTO_PTR
|
||||
|
||||
template<class Y>
|
||||
shared_ptr & operator=( std::auto_ptr<Y> & r )
|
||||
shared_ptr & operator=( std::unique_ptr<Y> & r )
|
||||
{
|
||||
this_type( r ).swap( *this );
|
||||
return *this;
|
||||
@@ -526,16 +526,16 @@ public:
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
template<class Y>
|
||||
shared_ptr & operator=( std::auto_ptr<Y> && r )
|
||||
shared_ptr & operator=( std::unique_ptr<Y> && r )
|
||||
{
|
||||
this_type( static_cast< std::auto_ptr<Y> && >( r ) ).swap( *this );
|
||||
this_type( static_cast< std::unique_ptr<Y> && >( r ) ).swap( *this );
|
||||
return *this;
|
||||
}
|
||||
|
||||
#elif !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
|
||||
template<class Ap>
|
||||
typename boost::detail::sp_enable_if_auto_ptr< Ap, shared_ptr & >::type operator=( Ap r )
|
||||
typename boost::detail::sp_enable_if_unique_ptr< Ap, shared_ptr & >::type operator=( Ap r )
|
||||
{
|
||||
this_type( r ).swap( *this );
|
||||
return *this;
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@
|
||||
#include <boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <memory> // for std::auto_ptr
|
||||
#include <memory> // for std::unique_ptr
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#endif
|
||||
|
||||
@@ -155,7 +155,7 @@ struct grammar_definition
|
||||
if (definitions[id]!=0)
|
||||
return *definitions[id];
|
||||
|
||||
std::auto_ptr<definition_t>
|
||||
std::unique_ptr<definition_t>
|
||||
result(new definition_t(target_grammar->derived()));
|
||||
|
||||
#ifdef BOOST_SPIRIT_THREADSAFE
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define BOOST_SPIRIT_TST_IPP
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#include <memory> // for std::auto_ptr
|
||||
#include <memory> // for std::unique_ptr
|
||||
#include <boost/spirit/home/classic/core/assert.hpp>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -62,7 +62,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
|
||||
tst_node*
|
||||
clone() const
|
||||
{
|
||||
std::auto_ptr<tst_node> copy(new tst_node(value));
|
||||
std::unique_ptr<tst_node> copy(new tst_node(value));
|
||||
|
||||
if (left)
|
||||
copy->left = left->clone();
|
||||
@@ -75,7 +75,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
|
||||
}
|
||||
else
|
||||
{
|
||||
std::auto_ptr<T> mid_data(new T(*middle.data));
|
||||
std::unique_ptr<T> mid_data(new T(*middle.data));
|
||||
copy->middle.data = mid_data.release();
|
||||
}
|
||||
|
||||
|
||||
@@ -615,7 +615,7 @@ public:
|
||||
tree_match(tree_match const& x)
|
||||
: match<T>(x), trees()
|
||||
{
|
||||
// use auto_ptr like ownership for the trees data member
|
||||
// use unique_ptr like ownership for the trees data member
|
||||
impl::cp_swap(trees, x.trees);
|
||||
}
|
||||
|
||||
@@ -1552,7 +1552,7 @@ struct tree_parse_info
|
||||
using boost::swap;
|
||||
using BOOST_SPIRIT_CLASSIC_NS::swap;
|
||||
|
||||
// use auto_ptr like ownership for the trees data member
|
||||
// use unique_ptr like ownership for the trees data member
|
||||
swap(trees, pi.trees);
|
||||
}
|
||||
|
||||
@@ -1572,7 +1572,7 @@ struct tree_parse_info
|
||||
using boost::swap;
|
||||
using BOOST_SPIRIT_CLASSIC_NS::swap;
|
||||
|
||||
// use auto_ptr like ownership for the trees data member
|
||||
// use unique_ptr like ownership for the trees data member
|
||||
swap(trees, trees_);
|
||||
}
|
||||
};
|
||||
|
||||
+4
-4
@@ -116,10 +116,10 @@ public:
|
||||
protected:
|
||||
typedef detail::basic_charset<CharT> charset;
|
||||
typedef detail::ptr_list<charset> charset_list;
|
||||
typedef std::auto_ptr<charset> charset_ptr;
|
||||
typedef std::unique_ptr<charset> charset_ptr;
|
||||
typedef detail::equivset equivset;
|
||||
typedef detail::ptr_list<equivset> equivset_list;
|
||||
typedef std::auto_ptr<equivset> equivset_ptr;
|
||||
typedef std::unique_ptr<equivset> equivset_ptr;
|
||||
typedef typename charset::index_set index_set;
|
||||
typedef std::vector<index_set> index_set_vector;
|
||||
typedef detail::basic_parser<CharT> parser;
|
||||
@@ -377,8 +377,8 @@ protected:
|
||||
if (followpos_->empty ()) return npos;
|
||||
|
||||
std::size_t index_ = 0;
|
||||
std::auto_ptr<node_set> set_ptr_ (new node_set);
|
||||
std::auto_ptr<node_vector> vector_ptr_ (new node_vector);
|
||||
std::unique_ptr<node_set> set_ptr_ (new node_set);
|
||||
std::unique_ptr<node_vector> vector_ptr_ (new node_vector);
|
||||
|
||||
for (typename detail::node::node_vector::const_iterator iter_ =
|
||||
followpos_->begin (), end_ = followpos_->end ();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <boost/detail/allocator_utilities.hpp>
|
||||
|
||||
#include <set>
|
||||
#include <memory> // std::allocator, std::auto_ptr
|
||||
#include <memory> // std::allocator, std::unique_ptr
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ template<
|
||||
class processor_container : noncopyable
|
||||
{
|
||||
typedef event_processor< Scheduler > processor_base_type;
|
||||
typedef std::auto_ptr< processor_base_type > processor_holder_type;
|
||||
typedef std::unique_ptr< processor_base_type > processor_holder_type;
|
||||
typedef shared_ptr< processor_holder_type > processor_holder_ptr_type;
|
||||
|
||||
public:
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ is_valid_identifier( cstring const& source )
|
||||
// ************************************************************************** //
|
||||
|
||||
struct include_level;
|
||||
typedef std::auto_ptr<include_level> include_level_ptr;
|
||||
typedef std::unique_ptr<include_level> include_level_ptr;
|
||||
|
||||
struct include_level : noncopyable
|
||||
{
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace boost
|
||||
thread* create_thread(F threadfunc)
|
||||
{
|
||||
boost::lock_guard<shared_mutex> guard(m);
|
||||
std::auto_ptr<thread> new_thread(new thread(threadfunc));
|
||||
std::unique_ptr<thread> new_thread(new thread(threadfunc));
|
||||
threads.push_back(new_thread.get());
|
||||
return new_thread.release();
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,6 +12,6 @@
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::allocator, 1)
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::raw_storage_iterator, 2)
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::auto_ptr, 1)
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::unique_ptr, 1)
|
||||
|
||||
#endif//BOOST_TYPEOF_STD_memory_hpp_INCLUDED
|
||||
|
||||
@@ -471,14 +471,14 @@ unsigned int PK_FixedLengthDecryptor::Decrypt(const byte *cipherText, unsigned i
|
||||
|
||||
void PK_Signer::SignMessage(RandomNumberGenerator &rng, const byte *message, unsigned int messageLen, byte *signature) const
|
||||
{
|
||||
std::auto_ptr<HashModule> accumulator(NewMessageAccumulator());
|
||||
std::unique_ptr<HashModule> accumulator(NewMessageAccumulator());
|
||||
accumulator->Update(message, messageLen);
|
||||
Sign(rng, accumulator.release(), signature);
|
||||
}
|
||||
|
||||
bool PK_Verifier::VerifyMessage(const byte *message, unsigned int messageLen, const byte *sig) const
|
||||
{
|
||||
std::auto_ptr<HashModule> accumulator(NewMessageAccumulator());
|
||||
std::unique_ptr<HashModule> accumulator(NewMessageAccumulator());
|
||||
accumulator->Update(message, messageLen);
|
||||
return Verify(accumulator.release(), sig);
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ void ProxyFilter::SetFilter(Filter *filter)
|
||||
m_filter.reset(filter);
|
||||
if (filter)
|
||||
{
|
||||
std::auto_ptr<OutputProxy> temp(m_proxy = new OutputProxy(*this, passSignal));
|
||||
std::unique_ptr<OutputProxy> temp(m_proxy = new OutputProxy(*this, passSignal));
|
||||
m_filter->TransferAllTo(*m_proxy);
|
||||
m_filter->Attach(temp.release());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user