os/ossrv/ossrv_pub/boost_apis/boost/range/detail/end.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/range/detail/end.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,161 @@
     1.4 +// Boost.Range library
     1.5 +//
     1.6 +//  Copyright Thorsten Ottosen 2003-2004. Use, modification and
     1.7 +//  distribution is subject to the Boost Software License, Version
     1.8 +//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
     1.9 +//  http://www.boost.org/LICENSE_1_0.txt)
    1.10 +//
    1.11 +// For more information, see http://www.boost.org/libs/range/
    1.12 +//
    1.13 +
    1.14 +#ifndef BOOST_RANGE_DETAIL_END_HPP
    1.15 +#define BOOST_RANGE_DETAIL_END_HPP
    1.16 +
    1.17 +#include <boost/config.hpp> // BOOST_MSVC
    1.18 +#include <boost/detail/workaround.hpp>
    1.19 +
    1.20 +#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
    1.21 +# include <boost/range/detail/vc6/end.hpp>
    1.22 +#else
    1.23 +# include <boost/range/detail/implementation_help.hpp>
    1.24 +# include <boost/range/detail/implementation_help.hpp>
    1.25 +# include <boost/range/result_iterator.hpp>
    1.26 +# include <boost/range/detail/common.hpp>
    1.27 +# if BOOST_WORKAROUND(BOOST_MSVC, < 1310)
    1.28 +#  include <boost/range/detail/remove_extent.hpp>
    1.29 +# endif
    1.30 +
    1.31 +namespace boost 
    1.32 +{
    1.33 +    namespace range_detail
    1.34 +    {
    1.35 +        template< typename T >
    1.36 +        struct range_end;
    1.37 +
    1.38 +        //////////////////////////////////////////////////////////////////////
    1.39 +        // default
    1.40 +        //////////////////////////////////////////////////////////////////////
    1.41 +        
    1.42 +        template<>
    1.43 +        struct range_end<std_container_>
    1.44 +        {
    1.45 +            template< typename C >
    1.46 +            static BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<C>::type 
    1.47 +            fun( C& c )
    1.48 +            {
    1.49 +                return c.end();
    1.50 +            };
    1.51 +        };
    1.52 +                    
    1.53 +        //////////////////////////////////////////////////////////////////////
    1.54 +        // pair
    1.55 +        //////////////////////////////////////////////////////////////////////
    1.56 +        
    1.57 +        template<>
    1.58 +        struct range_end<std_pair_>
    1.59 +        {
    1.60 +            template< typename P >
    1.61 +            static BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<P>::type 
    1.62 +            fun( const P& p )
    1.63 +            {
    1.64 +                return p.second;
    1.65 +            }
    1.66 +        };
    1.67 + 
    1.68 +        //////////////////////////////////////////////////////////////////////
    1.69 +        // array
    1.70 +        //////////////////////////////////////////////////////////////////////
    1.71 +        
    1.72 +        template<>
    1.73 +        struct range_end<array_>  
    1.74 +        {
    1.75 +        #if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
    1.76 +            template< typename T, std::size_t sz >
    1.77 +            static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] )
    1.78 +            {
    1.79 +                return boost::range_detail::array_end( boost_range_array );
    1.80 +            }
    1.81 +        #else
    1.82 +            template<typename T>
    1.83 +            static BOOST_RANGE_DEDUCED_TYPENAME remove_extent<T>::type* fun(T& t)
    1.84 +            {
    1.85 +                return t + remove_extent<T>::size;
    1.86 +            }
    1.87 +        #endif
    1.88 +        };
    1.89 +
    1.90 +                
    1.91 +        template<>
    1.92 +        struct range_end<char_array_>
    1.93 +        {
    1.94 +            template< typename T, std::size_t sz >
    1.95 +            static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] )
    1.96 +            {
    1.97 +                return boost::range_detail::array_end( boost_range_array );
    1.98 +            }
    1.99 +        };
   1.100 +        
   1.101 +        template<>
   1.102 +        struct range_end<wchar_t_array_>
   1.103 +        {
   1.104 +            template< typename T, std::size_t sz >
   1.105 +            static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] )
   1.106 +            {
   1.107 +                return boost::range_detail::array_end( boost_range_array );
   1.108 +            }
   1.109 +        };
   1.110 +
   1.111 +        //////////////////////////////////////////////////////////////////////
   1.112 +        // string
   1.113 +        //////////////////////////////////////////////////////////////////////
   1.114 +        
   1.115 +        template<>
   1.116 +        struct range_end<char_ptr_>
   1.117 +        {
   1.118 +            static char* fun( char* s )
   1.119 +            {
   1.120 +                return boost::range_detail::str_end( s );
   1.121 +            }
   1.122 +        };
   1.123 +
   1.124 +        template<>
   1.125 +        struct range_end<const_char_ptr_>
   1.126 +        {
   1.127 +            static const char* fun( const char* s )
   1.128 +            {
   1.129 +                return boost::range_detail::str_end( s );
   1.130 +            }
   1.131 +        };
   1.132 +
   1.133 +        template<>
   1.134 +        struct range_end<wchar_t_ptr_>
   1.135 +        {
   1.136 +            static wchar_t* fun( wchar_t* s )
   1.137 +            {
   1.138 +                return boost::range_detail::str_end( s );
   1.139 +            }
   1.140 +        };
   1.141 +
   1.142 +
   1.143 +        template<>
   1.144 +        struct range_end<const_wchar_t_ptr_>
   1.145 +        {
   1.146 +            static const wchar_t* fun( const wchar_t* s )
   1.147 +            {
   1.148 +                return boost::range_detail::str_end( s );
   1.149 +            }
   1.150 +        };
   1.151 +        
   1.152 +    } // namespace 'range_detail'
   1.153 +    
   1.154 +    template< typename C >
   1.155 +    inline BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<C>::type 
   1.156 +    end( C& c )
   1.157 +    {
   1.158 +        return range_detail::range_end< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
   1.159 +    }
   1.160 +    
   1.161 +} // namespace 'boost'
   1.162 +
   1.163 +# endif // VC6
   1.164 +#endif