diff options
Diffstat (limited to 'boost/ptr_container/ptr_set_adapter.hpp')
-rw-r--r-- | boost/ptr_container/ptr_set_adapter.hpp | 102 |
1 files changed, 100 insertions, 2 deletions
diff --git a/boost/ptr_container/ptr_set_adapter.hpp b/boost/ptr_container/ptr_set_adapter.hpp index 9274fd9bda..c4d99d135b 100644 --- a/boost/ptr_container/ptr_set_adapter.hpp +++ b/boost/ptr_container/ptr_set_adapter.hpp @@ -19,8 +19,14 @@ #include <boost/ptr_container/detail/associative_ptr_container.hpp> #include <boost/ptr_container/detail/meta_functions.hpp> #include <boost/ptr_container/detail/void_ptr_iterator.hpp> +#include <boost/ptr_container/detail/ptr_container_disable_deprecated.hpp> #include <boost/range/iterator_range.hpp> +#if defined(BOOST_PTR_CONTAINER_DISABLE_DEPRECATED) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + namespace boost { namespace ptr_container_detail @@ -182,10 +188,18 @@ namespace ptr_container_detail : base_type( r ) { } +#ifndef BOOST_NO_AUTO_PTR template< class PtrContainer > explicit ptr_set_adapter_base( std::auto_ptr<PtrContainer> clone ) : base_type( clone ) { } +#endif +#ifndef BOOST_NO_CXX11_SMART_PTR + template< class PtrContainer > + explicit ptr_set_adapter_base( std::unique_ptr<PtrContainer> clone ) + : base_type( std::move( clone ) ) + { } +#endif ptr_set_adapter_base& operator=( ptr_set_adapter_base r ) { @@ -193,12 +207,22 @@ namespace ptr_container_detail return *this; } +#ifndef BOOST_NO_AUTO_PTR template< typename PtrContainer > - ptr_set_adapter_base& operator=( std::auto_ptr<PtrContainer> clone ) + ptr_set_adapter_base& operator=( std::auto_ptr<PtrContainer> clone ) { base_type::operator=( clone ); return *this; } +#endif +#ifndef BOOST_NO_CXX11_SMART_PTR + template< typename PtrContainer > + ptr_set_adapter_base& operator=( std::unique_ptr<PtrContainer> clone ) + { + base_type::operator=( std::move( clone ) ); + return *this; + } +#endif using base_type::erase; @@ -393,10 +417,18 @@ namespace ptr_container_detail : base_type( r ) { } +#ifndef BOOST_NO_AUTO_PTR template< class PtrContainer > explicit ptr_set_adapter( std::auto_ptr<PtrContainer> clone ) : base_type( clone ) { } +#endif +#ifndef BOOST_NO_CXX11_SMART_PTR + template< class PtrContainer > + explicit ptr_set_adapter( std::unique_ptr<PtrContainer> clone ) + : base_type( std::move( clone ) ) + { } +#endif template< class U, class Set, class CA, bool b > ptr_set_adapter& operator=( const ptr_set_adapter<U,Set,CA,b>& r ) @@ -405,11 +437,20 @@ namespace ptr_container_detail return *this; } +#ifndef BOOST_NO_AUTO_PTR template< class T > - void operator=( std::auto_ptr<T> r ) + void operator=( std::auto_ptr<T> r ) { base_type::operator=( r ); } +#endif +#ifndef BOOST_NO_CXX11_SMART_PTR + template< class T > + void operator=( std::unique_ptr<T> r ) + { + base_type::operator=( std::move( r ) ); + } +#endif std::pair<iterator,bool> insert( key_type* x ) // strong { @@ -423,11 +464,20 @@ namespace ptr_container_detail return std::make_pair( iterator( res.first ), res.second ); } +#ifndef BOOST_NO_AUTO_PTR template< class U > std::pair<iterator,bool> insert( std::auto_ptr<U> x ) { return insert( x.release() ); } +#endif +#ifndef BOOST_NO_CXX11_SMART_PTR + template< class U > + std::pair<iterator,bool> insert( std::unique_ptr<U> x ) + { + return insert( x.release() ); + } +#endif iterator insert( iterator where, key_type* x ) // strong @@ -442,11 +492,20 @@ namespace ptr_container_detail return iterator( res); } +#ifndef BOOST_NO_AUTO_PTR template< class U > iterator insert( iterator where, std::auto_ptr<U> x ) { return insert( where, x.release() ); } +#endif +#ifndef BOOST_NO_CXX11_SMART_PTR + template< class U > + iterator insert( iterator where, std::unique_ptr<U> x ) + { + return insert( where, x.release() ); + } +#endif template< typename InputIterator > void insert( InputIterator first, InputIterator last ) // basic @@ -593,10 +652,18 @@ namespace ptr_container_detail : base_type( r ) { } +#ifndef BOOST_NO_AUTO_PTR template< class PtrContainer > explicit ptr_multiset_adapter( std::auto_ptr<PtrContainer> clone ) : base_type( clone ) { } +#endif +#ifndef BOOST_NO_CXX11_SMART_PTR + template< class PtrContainer > + explicit ptr_multiset_adapter( std::unique_ptr<PtrContainer> clone ) + : base_type( std::move( clone ) ) + { } +#endif template< class U, class Set, class CA, bool b > ptr_multiset_adapter& operator=( const ptr_multiset_adapter<U,Set,CA,b>& r ) @@ -605,22 +672,40 @@ namespace ptr_container_detail return *this; } +#ifndef BOOST_NO_AUTO_PTR template< class T > void operator=( std::auto_ptr<T> r ) { base_type::operator=( r ); } +#endif +#ifndef BOOST_NO_CXX11_SMART_PTR + template< class T > + void operator=( std::unique_ptr<T> r ) + { + base_type::operator=( std::move( r ) ); + } +#endif iterator insert( iterator before, key_type* x ) // strong { return base_type::insert( before, x ); } +#ifndef BOOST_NO_AUTO_PTR template< class U > iterator insert( iterator before, std::auto_ptr<U> x ) { return insert( before, x.release() ); } +#endif +#ifndef BOOST_NO_CXX11_SMART_PTR + template< class U > + iterator insert( iterator before, std::unique_ptr<U> x ) + { + return insert( before, x.release() ); + } +#endif iterator insert( key_type* x ) // strong { @@ -633,11 +718,20 @@ namespace ptr_container_detail return iterator( res ); } +#ifndef BOOST_NO_AUTO_PTR template< class U > iterator insert( std::auto_ptr<U> x ) { return insert( x.release() ); } +#endif +#ifndef BOOST_NO_CXX11_SMART_PTR + template< class U > + iterator insert( std::unique_ptr<U> x ) + { + return insert( x.release() ); + } +#endif template< typename InputIterator > void insert( InputIterator first, InputIterator last ) // basic @@ -697,4 +791,8 @@ namespace ptr_container_detail } // namespace 'boost' +#if defined(BOOST_PTR_CONTAINER_DISABLE_DEPRECATED) +#pragma GCC diagnostic pop +#endif + #endif |