Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51266 - in trunk/boost/ptr_container: . detail
From: nesotto_at_[hidden]
Date: 2009-02-15 16:45:25


Author: nesotto
Date: 2009-02-15 16:45:25 EST (Sun, 15 Feb 2009)
New Revision: 51266
URL: http://svn.boost.org/trac/boost/changeset/51266

Log:
fixed bug in ptr_sequence_adapter.hpp, plus removed some warnings in detail/reversible_ptr_container.hpp. added new overload of new_clone() that allows for null-values.
Text files modified:
   trunk/boost/ptr_container/clone_allocator.hpp | 13 +++++++++++++
   trunk/boost/ptr_container/detail/reversible_ptr_container.hpp | 8 ++++----
   trunk/boost/ptr_container/ptr_sequence_adapter.hpp | 6 +++---
   3 files changed, 20 insertions(+), 7 deletions(-)

Modified: trunk/boost/ptr_container/clone_allocator.hpp
==============================================================================
--- trunk/boost/ptr_container/clone_allocator.hpp (original)
+++ trunk/boost/ptr_container/clone_allocator.hpp 2009-02-15 16:45:25 EST (Sun, 15 Feb 2009)
@@ -38,6 +38,19 @@
     }
 
     template< class T >
+ inline T* new_clone( const T* r )
+ {
+ return r ? new_clone( *r ) : 0;
+ }
+
+ //
+ // @remark: to make new_clone() work
+ // with scope_ptr/shared_ptr ect.
+ // simply overload for those types
+ // in the appropriate namespace.
+ //
+
+ template< class T >
     inline void delete_clone( const T* r )
     {
         checked_delete( r );

Modified: trunk/boost/ptr_container/detail/reversible_ptr_container.hpp
==============================================================================
--- trunk/boost/ptr_container/detail/reversible_ptr_container.hpp (original)
+++ trunk/boost/ptr_container/detail/reversible_ptr_container.hpp 2009-02-15 16:45:25 EST (Sun, 15 Feb 2009)
@@ -437,18 +437,18 @@
           : c_( n ) {}
 
         template< class Hash, class Pred >
- reversible_ptr_container( const Hash& hash,
+ reversible_ptr_container( const Hash& h,
                                   const Pred& pred,
                                   const allocator_type& a )
- : c_( hash, pred, a ) {}
+ : c_( h, pred, a ) {}
 
         template< class InputIterator, class Hash, class Pred >
         reversible_ptr_container( InputIterator first,
                                   InputIterator last,
- const Hash& hash,
+ const Hash& h,
                                   const Pred& pred,
                                   const allocator_type& a )
- : c_( hash, pred, a )
+ : c_( h, pred, a )
         {
             associative_constructor_impl( first, last );
         }

Modified: trunk/boost/ptr_container/ptr_sequence_adapter.hpp
==============================================================================
--- trunk/boost/ptr_container/ptr_sequence_adapter.hpp (original)
+++ trunk/boost/ptr_container/ptr_sequence_adapter.hpp 2009-02-15 16:45:25 EST (Sun, 15 Feb 2009)
@@ -9,8 +9,8 @@
 // For more information, see http://www.boost.org/libs/ptr_container/
 //
 
-#ifndef BOOST_ptr_container_PTR_SEQUENCE_ADAPTER_HPP
-#define BOOST_ptr_container_PTR_SEQUENCE_ADAPTER_HPP
+#ifndef BOOST_PTR_CONTAINER_PTR_SEQUENCE_ADAPTER_HPP
+#define BOOST_PTR_CONTAINER_PTR_SEQUENCE_ADAPTER_HPP
 
 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
 # pragma once
@@ -723,7 +723,7 @@
             range_check(first,last);
             this->base().erase( std::remove_if( first.base(), last.base(),
                                                 void_ptr_delete_if<Pred,value_type>(pred) ),
- this->base().end() );
+ last.base() );
         }
         
         template< class Pred >


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk