#include <boost/ptr_container/detail/map_iterator.hpp>
#include <boost/ptr_container/detail/associative_ptr_container.hpp>
#include <boost/ptr_container/detail/meta_functions.hpp>
+#include <boost/ptr_container/detail/ptr_container_disable_deprecated.hpp>
#include <boost/static_assert.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
: base_type( first, last, hash, pred, a )
{ }
+#ifndef BOOST_NO_AUTO_PTR
template< class PtrContainer >
- explicit ptr_map_adapter_base( std::auto_ptr<PtrContainer> clone )
+ explicit ptr_map_adapter_base( std::auto_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::auto_ptr<PtrContainer> clone )
{
base_type::operator=( clone );
return *this;
}
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ template< class PtrContainer >
+ explicit ptr_map_adapter_base( std::unique_ptr<PtrContainer> clone )
+ : base_type( std::move( clone ) )
+ { }
+
+ template< typename PtrContainer >
+ ptr_map_adapter_base& operator=( std::unique_ptr<PtrContainer> clone )
+ {
+ base_type::operator=( std::move( clone ) );
+ return *this;
+ }
+#endif
iterator find( const key_type& x )
{
return boost::ptr_container::move( old );
}
+#ifndef BOOST_NO_AUTO_PTR
template< class U >
auto_type replace( iterator where, std::auto_ptr<U> x )
{
return replace( where, x.release() );
}
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ template< class U >
+ auto_type replace( iterator where, std::unique_ptr<U> x )
+ {
+ return replace( where, x.release() );
+ }
+#endif
protected:
size_type bucket( const key_type& key ) const
map_basic_clone_and_insert( r.begin(), r.end() );
}
+#ifndef BOOST_NO_AUTO_PTR
template< class U >
ptr_map_adapter( std::auto_ptr<U> r ) : base_type( r )
{ }
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ template< class U >
+ ptr_map_adapter( std::unique_ptr<U> r ) : base_type( std::move( r ) )
+ { }
+#endif
ptr_map_adapter& operator=( ptr_map_adapter r )
{
return *this;
}
+#ifndef BOOST_NO_AUTO_PTR
template< class U >
ptr_map_adapter& operator=( std::auto_ptr<U> r )
- {
+ {
base_type::operator=( r );
return *this;
}
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ template< class U >
+ ptr_map_adapter& operator=( std::unique_ptr<U> r )
+ {
+ base_type::operator=( std::move( r ) );
+ return *this;
+ }
+#endif
using base_type::release;
return insert_impl( key, x );
}
+#ifndef BOOST_NO_AUTO_PTR
template< class U >
std::pair<iterator,bool> insert( const key_type& key, std::auto_ptr<U> x )
{
return insert_impl( key, x.release() );
}
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ template< class U >
+ std::pair<iterator,bool> insert( const key_type& key, std::unique_ptr<U> x )
+ {
+ return insert_impl( key, x.release() );
+ }
+#endif
template< class F, class S >
iterator insert( iterator before, ptr_container_detail::ref_pair<F,S> p ) // strong
return insert_impl( before, key, x );
}
+#ifndef BOOST_NO_AUTO_PTR
template< class U >
iterator insert( iterator before, const key_type& key, std::auto_ptr<U> x ) // strong
{
return insert_impl( before, key, x.release() );
}
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ template< class U >
+ iterator insert( iterator before, const key_type& key, std::unique_ptr<U> x ) // strong
+ {
+ return insert_impl( before, key, x.release() );
+ }
+#endif
template< class PtrMapAdapter >
bool transfer( BOOST_DEDUCED_TYPENAME PtrMapAdapter::iterator object,
map_basic_clone_and_insert( r.begin(), r.end() );
}
+#ifndef BOOST_NO_AUTO_PTR
template< class U >
explicit ptr_multimap_adapter( std::auto_ptr<U> r ) : base_type( r )
{ }
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ template< class U >
+ explicit ptr_multimap_adapter( std::unique_ptr<U> r ) : base_type( std::move( r ) )
+ { }
+#endif
ptr_multimap_adapter& operator=( ptr_multimap_adapter r )
{
return *this;
}
+#ifndef BOOST_NO_AUTO_PTR
template< class U >
ptr_multimap_adapter& operator=( std::auto_ptr<U> r )
{
base_type::operator=( r );
return *this;
}
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ template< class U >
+ ptr_multimap_adapter& operator=( std::unique_ptr<U> r )
+ {
+ base_type::operator=( std::move( r ) );
+ return *this;
+ }
+#endif
using base_type::release;
return insert_impl( key, x );
}
+#ifndef BOOST_NO_AUTO_PTR
template< class U >
iterator insert( const key_type& key, std::auto_ptr<U> x )
{
return insert_impl( key, x.release() );
}
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ template< class U >
+ iterator insert( const key_type& key, std::unique_ptr<U> x )
+ {
+ return insert_impl( key, x.release() );
+ }
+#endif
template< class F, class S >
iterator insert( iterator before, ptr_container_detail::ref_pair<F,S> p ) // strong
return insert_impl( before, key, x );
}
+#ifndef BOOST_NO_AUTO_PTR
template< class U >
iterator insert( iterator before, const key_type& key, std::auto_ptr<U> x ) // strong
{
return insert_impl( before, key, x.release() );
}
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ template< class U >
+ iterator insert( iterator before, const key_type& key, std::unique_ptr<U> x ) // strong
+ {
+ return insert_impl( before, key, x.release() );
+ }
+#endif
template< class PtrMapAdapter >
void transfer( BOOST_DEDUCED_TYPENAME PtrMapAdapter::iterator object,
} // namespace 'boost'
+#if defined(BOOST_PTR_CONTAINER_DISABLE_DEPRECATED)
+#pragma GCC diagnostic pop
+#endif
+
#endif