epoc32/include/stdapis/boost/ptr_container/ptr_list.hpp
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/ptr_container/ptr_list.hpp	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,95 @@
     1.4 +//
     1.5 +// Boost.Pointer Container
     1.6 +//
     1.7 +//  Copyright Thorsten Ottosen 2003-2005. Use, modification and
     1.8 +//  distribution is subject to the Boost Software License, Version
     1.9 +//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
    1.10 +//  http://www.boost.org/LICENSE_1_0.txt)
    1.11 +//
    1.12 +// For more information, see http://www.boost.org/libs/ptr_container/
    1.13 +//
    1.14 +
    1.15 +#ifndef BOOST_PTR_CONTAINER_PTR_LIST_HPP
    1.16 +#define BOOST_PTR_CONTAINER_PTR_LIST_HPP
    1.17 +
    1.18 +#if defined(_MSC_VER) && (_MSC_VER >= 1200)
    1.19 +# pragma once
    1.20 +#endif
    1.21 +
    1.22 +#include <boost/ptr_container/ptr_sequence_adapter.hpp>
    1.23 +#include <list>
    1.24 +
    1.25 +namespace boost
    1.26 +{
    1.27 +
    1.28 +    template
    1.29 +    < 
    1.30 +        class T, 
    1.31 +        class CloneAllocator = heap_clone_allocator,
    1.32 +        class Allocator      = std::allocator<void*>
    1.33 +    >
    1.34 +    class ptr_list : public 
    1.35 +        ptr_sequence_adapter< T, 
    1.36 +                              std::list<void*,Allocator>, 
    1.37 +                              CloneAllocator >
    1.38 +    {
    1.39 +        typedef    ptr_sequence_adapter< T, 
    1.40 +                                         std::list<void*,Allocator>, 
    1.41 +                                         CloneAllocator >
    1.42 +            base_class;
    1.43 +
    1.44 +        typedef ptr_list<T,CloneAllocator,Allocator> this_type;
    1.45 +        
    1.46 +    public:
    1.47 +        BOOST_PTR_CONTAINER_DEFINE_NON_INHERITED_MEMBERS( ptr_list, 
    1.48 +                                                          base_class,
    1.49 +                                                          this_type );
    1.50 +        
    1.51 +    public:
    1.52 +        using base_class::merge;
    1.53 +        
    1.54 +        void merge( ptr_list& x )                                 
    1.55 +        {
    1.56 +            merge( x, std::less<T>() );
    1.57 +        }
    1.58 +
    1.59 +        template< typename Compare > 
    1.60 +        void merge( ptr_list& x, Compare comp )                   
    1.61 +        {
    1.62 +            this->c_private().merge( x.c_private(), void_ptr_indirect_fun<Compare,T>( comp ) );
    1.63 +        }
    1.64 +
    1.65 +        void sort()                                                    
    1.66 +        { 
    1.67 +            sort( std::less<T>() ); 
    1.68 +        };
    1.69 +
    1.70 +        template< typename Compare > 
    1.71 +        void sort( Compare comp )                             
    1.72 +        {
    1.73 +            this->c_private().sort( void_ptr_indirect_fun<Compare,T>( comp ) );
    1.74 +        }
    1.75 +
    1.76 +    }; // class 'ptr_list'
    1.77 +
    1.78 +    //////////////////////////////////////////////////////////////////////////////
    1.79 +    // clonability
    1.80 +
    1.81 +    template< typename T, typename CA, typename A >
    1.82 +    inline ptr_list<T,CA,A>* new_clone( const ptr_list<T,CA,A>& r )
    1.83 +    {
    1.84 +        return r.clone().release();
    1.85 +    }
    1.86 +    
    1.87 +    /////////////////////////////////////////////////////////////////////////
    1.88 +    // swap
    1.89 +
    1.90 +    template< typename T, typename CA, typename A >
    1.91 +    inline void swap( ptr_list<T,CA,A>& l, ptr_list<T,CA,A>& r )
    1.92 +    {
    1.93 +        l.swap(r);
    1.94 +    }
    1.95 +}
    1.96 +
    1.97 +
    1.98 +#endif