Boost logo

Boost-Commit :

From: nesotto_at_[hidden]
Date: 2007-10-25 16:51:16


Author: nesotto
Date: 2007-10-25 16:51:16 EDT (Thu, 25 Oct 2007)
New Revision: 40467
URL: http://svn.boost.org/trac/boost/changeset/40467

Log:
proper definition of the conversion operator
Text files modified:
   trunk/boost/assign/ptr_list_of.hpp | 19 ++++++++++++++-----
   1 files changed, 14 insertions(+), 5 deletions(-)

Modified: trunk/boost/assign/ptr_list_of.hpp
==============================================================================
--- trunk/boost/assign/ptr_list_of.hpp (original)
+++ trunk/boost/assign/ptr_list_of.hpp 2007-10-25 16:51:16 EDT (Thu, 25 Oct 2007)
@@ -58,10 +58,11 @@
         generic_ptr_list() : values_( 32u )
         { }
 
+ /*
         generic_ptr_list( const generic_ptr_list& r )
         {
             values_.swap(r.values_);
- }
+ }*/
         
         generic_ptr_list( release_type r ) : values_(r)
         { }
@@ -79,11 +80,19 @@
 
     public:
 
- template< class PtrContainer >
- operator std::auto_ptr<PtrContainer>() const
+ operator impl_type() const
         {
- PtrContainer* type = 0;
- return convert( type );
+ return values_;
+ }
+
+ template< template<class,class,class> class Seq, class U,
+ class CA, class A >
+ operator Seq<U,CA,A>() const
+ {
+ Seq<U,CA,A> result;
+ result.transfer( result.end(), values_ );
+ BOOST_ASSERT( empty() );
+ return result;
         }
 
         template< class PtrContainer >


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