Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:51:16

0001 // Boost.Range library
0002 //
0003 //  Copyright Thorsten Ottosen 2003-2004. Use, modification and
0004 //  distribution is subject to the Boost Software License, Version
0005 //  1.0. (See accompanying file LICENSE_1_0.txt or copy at
0006 //  http://www.boost.org/LICENSE_1_0.txt)
0007 //
0008 // For more information, see http://www.boost.org/libs/range/
0009 //
0010 
0011 #ifndef BOOST_RANGE_DETAIL_DIFFERENCE_TYPE_HPP
0012 #define BOOST_RANGE_DETAIL_DIFFERENCE_TYPE_HPP
0013 
0014 #include <boost/range/detail/common.hpp>
0015 #include <boost/iterator/iterator_traits.hpp>
0016 
0017 //////////////////////////////////////////////////////////////////////////////
0018 // missing partial specialization  workaround.
0019 //////////////////////////////////////////////////////////////////////////////
0020 
0021 namespace boost 
0022 {
0023     namespace range_detail 
0024     {        
0025         template< typename T >
0026         struct range_difference_type_;
0027 
0028         template<>
0029         struct range_difference_type_<std_container_>
0030         {
0031             template< typename C >
0032             struct pts
0033             {
0034                 typedef BOOST_DEDUCED_TYPENAME C::difference_type type;
0035             };
0036         };
0037 
0038         template<>
0039         struct range_difference_type_<std_pair_>
0040         {
0041             template< typename P >
0042             struct pts
0043             {
0044                 typedef BOOST_RANGE_DEDUCED_TYPENAME boost::iterator_difference< BOOST_DEDUCED_TYPENAME P::first_type>::type type;                
0045             };
0046         };
0047 
0048         template<>
0049         struct range_difference_type_<array_>
0050         {
0051             template< typename A >
0052             struct pts
0053             {
0054                 typedef std::ptrdiff_t type;
0055             };
0056         };
0057 
0058         template<>
0059         struct range_difference_type_<char_array_>
0060         { 
0061             template< typename A >
0062             struct pts
0063             {
0064                 typedef std::ptrdiff_t type;
0065             };
0066         };
0067 
0068         template<>
0069         struct range_difference_type_<char_ptr_>
0070         {
0071             template< typename S >
0072             struct pts
0073             {
0074                 typedef std::ptrdiff_t type;
0075             };         
0076         };
0077         
0078         template<>
0079         struct range_difference_type_<const_char_ptr_>
0080         {
0081             template< typename S >
0082             struct pts
0083             {
0084                 typedef std::ptrdiff_t type;
0085             };         
0086         };
0087         
0088         template<>
0089         struct range_difference_type_<wchar_t_ptr_>
0090         {
0091             template< typename S >
0092             struct pts
0093             {
0094                 typedef std::ptrdiff_t type;
0095             };         
0096         };
0097         
0098         template<>
0099         struct range_difference_type_<const_wchar_t_ptr_>
0100         {
0101             template< typename S >
0102             struct pts
0103             {
0104                 typedef std::ptrdiff_t type;
0105             };         
0106         };
0107         
0108     } 
0109     
0110     template< typename C >
0111     class range_difference
0112     {
0113         typedef BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
0114     public:
0115         typedef BOOST_RANGE_DEDUCED_TYPENAME range_detail::range_difference_type_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type; 
0116     };
0117 
0118 }
0119 
0120 #endif
0121