epoc32/include/stdapis/boost/mpl/iterator_range.hpp
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/stdapis/boost/mpl/iterator_range.hpp	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/stdapis/boost/mpl/iterator_range.hpp	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,608 +1,42 @@
     1.4 -// Boost.Range library
     1.5 +
     1.6 +#ifndef BOOST_MPL_ITERATOR_RANGE_HPP_INCLUDED
     1.7 +#define BOOST_MPL_ITERATOR_RANGE_HPP_INCLUDED
     1.8 +
     1.9 +// Copyright Aleksey Gurtovoy 2001-2004
    1.10  //
    1.11 -//  Copyright Thorsten Ottosen & Pavol Droba 2003-2004. Use, modification and
    1.12 -//  distribution is subject to the Boost Software License, Version
    1.13 -//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
    1.14 -//  http://www.boost.org/LICENSE_1_0.txt)
    1.15 +// Distributed under the Boost Software License, Version 1.0. 
    1.16 +// (See accompanying file LICENSE_1_0.txt or copy at 
    1.17 +// http://www.boost.org/LICENSE_1_0.txt)
    1.18  //
    1.19 -// For more information, see http://www.boost.org/libs/range/
    1.20 -//
    1.21 +// See http://www.boost.org/libs/mpl for documentation.
    1.22  
    1.23 -#ifndef BOOST_RANGE_ITERATOR_RANGE_HPP
    1.24 -#define BOOST_RANGE_ITERATOR_RANGE_HPP
    1.25 +// $Source: /cvsroot/boost/boost/boost/mpl/iterator_range.hpp,v $
    1.26 +// $Date: 2004/09/02 15:40:41 $
    1.27 +// $Revision: 1.4 $
    1.28  
    1.29 -// From boost/dynamic_bitset.hpp; thanks to Matthias Troyer for Cray X1 patch.
    1.30 -#include <boost/config.hpp> // Define __STL_CONFIG_H, if appropriate.
    1.31 -#ifndef BOOST_OLD_IOSTREAMS 
    1.32 -# if defined(__STL_CONFIG_H) && \
    1.33 -    !defined (__STL_USE_NEW_IOSTREAMS) && !defined(__crayx1) \
    1.34 -    /**/
    1.35 -#  define BOOST_OLD_IOSTREAMS
    1.36 -# endif
    1.37 -#endif // #ifndef BOOST_OLD_IOSTREAMS
    1.38 +#include <boost/mpl/aux_/na_spec.hpp>
    1.39 +#include <boost/mpl/aux_/lambda_support.hpp>
    1.40  
    1.41 -#include <boost/detail/workaround.hpp>
    1.42 -#include <boost/range/functions.hpp>
    1.43 -#include <boost/range/result_iterator.hpp>
    1.44 -#include <boost/range/difference_type.hpp>
    1.45 -#include <boost/iterator/iterator_traits.hpp>    
    1.46 -#include <boost/assert.hpp>
    1.47 -#include <iterator>
    1.48 -#include <algorithm>
    1.49 -#ifndef BOOST_OLD_IOSTREAMS
    1.50 -# include <ostream>
    1.51 -#else
    1.52 -# include <ostream.h>
    1.53 -#endif
    1.54 -#include <cstddef>
    1.55 +namespace boost { namespace mpl {
    1.56  
    1.57 +struct iterator_range_tag;
    1.58  
    1.59 -/*! \file
    1.60 -    Defines the \c iterator_class and related functions. 
    1.61 -    \c iterator_range is a simple wrapper of iterator pair idiom. It provides
    1.62 -    a rich subset of Container interface.
    1.63 -*/
    1.64 +template<
    1.65 +      typename BOOST_MPL_AUX_NA_PARAM(First)
    1.66 +    , typename BOOST_MPL_AUX_NA_PARAM(Last)
    1.67 +    >
    1.68 +struct iterator_range
    1.69 +{
    1.70 +    typedef iterator_range_tag tag;
    1.71 +    typedef iterator_range type;
    1.72 +    typedef First begin;
    1.73 +    typedef Last end;
    1.74  
    1.75 +    BOOST_MPL_AUX_LAMBDA_SUPPORT(2,iterator_range,(First,Last))
    1.76 +};
    1.77  
    1.78 -namespace boost 
    1.79 -{
    1.80 -    namespace iterator_range_detail
    1.81 -    {
    1.82 -        //
    1.83 -        // The functions adl_begin and adl_end are implemented in a separate
    1.84 -        // class for gcc-2.9x
    1.85 -        //
    1.86 -        template<typename IteratorT>
    1.87 -        struct iterator_range_impl {
    1.88 -            template< class ForwardRange >
    1.89 -            static IteratorT adl_begin( ForwardRange& r )
    1.90 -            {
    1.91 -                return IteratorT( boost::begin( r ) );
    1.92 -            }
    1.93 -            
    1.94 -            template< class ForwardRange >
    1.95 -            static IteratorT adl_end( ForwardRange& r )
    1.96 -            {
    1.97 -                return IteratorT( boost::end( r ) );
    1.98 -            }
    1.99 -        };
   1.100 - 
   1.101 -        template< class Left, class Right >
   1.102 -        inline bool equal( const Left& l, const Right& r )
   1.103 -        {
   1.104 -            typedef BOOST_DEDUCED_TYPENAME boost::range_size<Left>::type sz_type;
   1.105 +BOOST_MPL_AUX_NA_SPEC(2, iterator_range)
   1.106  
   1.107 -            sz_type l_size = boost::size( l ),
   1.108 -                    r_size = boost::size( r );
   1.109 +}}
   1.110  
   1.111 -            if( l_size != r_size )
   1.112 -                return false;
   1.113 -
   1.114 -            return std::equal( boost::begin(l), boost::end(l), 
   1.115 -                               boost::begin(r) );                
   1.116 -        }
   1.117 -
   1.118 -        template< class Left, class Right >
   1.119 -        inline bool less_than( const Left& l, const Right& r )
   1.120 -        {                
   1.121 -            return std::lexicographical_compare( boost::begin(l), 
   1.122 -                                                 boost::end(l), 
   1.123 -                                                 boost::begin(r), 
   1.124 -                                                 boost::end(r) );                
   1.125 -        }
   1.126 -           
   1.127 -        struct range_tag { };
   1.128 -        struct const_range_tag { };
   1.129 -
   1.130 -    }
   1.131 -
   1.132 -//  iterator range template class -----------------------------------------//
   1.133 -
   1.134 -        //! iterator_range class
   1.135 -        /*!
   1.136 -            An \c iterator_range delimits a range in a sequence by beginning and ending iterators. 
   1.137 -            An iterator_range can be passed to an algorithm which requires a sequence as an input. 
   1.138 -            For example, the \c toupper() function may be used most frequently on strings, 
   1.139 -            but can also be used on iterator_ranges: 
   1.140 -            
   1.141 -            \code
   1.142 -                boost::tolower( find( s, "UPPERCASE STRING" ) );
   1.143 -            \endcode
   1.144 -
   1.145 -            Many algorithms working with sequences take a pair of iterators, 
   1.146 -            delimiting a working range, as an arguments. The \c iterator_range class is an 
   1.147 -            encapsulation of a range identified by a pair of iterators. 
   1.148 -            It provides a collection interface, 
   1.149 -            so it is possible to pass an instance to an algorithm requiring a collection as an input. 
   1.150 -        */
   1.151 -        template<typename IteratorT> 
   1.152 -        class iterator_range
   1.153 -        {
   1.154 -        protected: // Used by sub_range
   1.155 -            //! implementation class
   1.156 -            typedef iterator_range_detail::iterator_range_impl<IteratorT> impl;
   1.157 -        public:
   1.158 -
   1.159 -            //! this type
   1.160 -            typedef iterator_range<IteratorT> type;
   1.161 -            //BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(value_type);
   1.162 -        
   1.163 -            //! Encapsulated value type
   1.164 -            typedef BOOST_DEDUCED_TYPENAME 
   1.165 -                iterator_value<IteratorT>::type value_type;
   1.166 -
   1.167 -            //! Difference type
   1.168 -            typedef BOOST_DEDUCED_TYPENAME 
   1.169 -                iterator_difference<IteratorT>::type difference_type;
   1.170 -            
   1.171 -            //! Size type
   1.172 -            typedef std::size_t size_type; // note: must be unsigned
   1.173 -
   1.174 -            //! This type
   1.175 -            typedef iterator_range<IteratorT> this_type;
   1.176 -
   1.177 -            //! Refence type
   1.178 -            //
   1.179 -            // Needed because value-type is the same for 
   1.180 -            // const and non-const iterators
   1.181 -            //
   1.182 -            typedef BOOST_DEDUCED_TYPENAME
   1.183 -                iterator_reference<IteratorT>::type reference;
   1.184 -            
   1.185 -            //! const_iterator type
   1.186 -            /*! 
   1.187 -                There is no distinction between const_iterator and iterator.
   1.188 -                These typedefs are provides to fulfill container interface
   1.189 -            */ 
   1.190 -            typedef IteratorT const_iterator;
   1.191 -            //! iterator type
   1.192 -            typedef IteratorT iterator;
   1.193 -
   1.194 -            iterator_range() : m_Begin( iterator() ), m_End( iterator() ), 
   1.195 -                               singular( true )
   1.196 -            { }
   1.197 -/*
   1.198 -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))  
   1.199 -            iterator_range( this_type r ) :
   1.200 -            : m_Begin(r.begin()), m_End(r.end())
   1.201 -            { }
   1.202 -
   1.203 -            this_type& operator=( this_type r )
   1.204 -            {
   1.205 -                m_Begin = r.begin();
   1.206 -                m_End   = r.end();
   1.207 -                return *this;
   1.208 -            }
   1.209 -#endif
   1.210 -*/            
   1.211 -            //! Constructor from a pair of iterators
   1.212 -            template< class Iterator >
   1.213 -            iterator_range( Iterator Begin, Iterator End ) : 
   1.214 -                m_Begin(Begin), m_End(End), singular(false) {}
   1.215 -
   1.216 -            //! Constructor from a Range
   1.217 -            template< class Range >
   1.218 -            iterator_range( const Range& r ) : 
   1.219 -                m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) ), 
   1.220 -                singular(false) {}
   1.221 -
   1.222 -            //! Constructor from a Range
   1.223 -            template< class Range >
   1.224 -            iterator_range( Range& r ) : 
   1.225 -                m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) ), 
   1.226 -                singular(false) {}
   1.227 -
   1.228 -            //! Constructor from a Range
   1.229 -            template< class Range >
   1.230 -            iterator_range( const Range& r, iterator_range_detail::const_range_tag ) : 
   1.231 -                m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) ), 
   1.232 -                singular(false) {}
   1.233 -
   1.234 -            //! Constructor from a Range
   1.235 -            template< class Range >
   1.236 -            iterator_range( Range& r, iterator_range_detail::range_tag ) : 
   1.237 -                m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) ), 
   1.238 -                singular(false) {}
   1.239 -
   1.240 -            #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
   1.241 -            this_type& operator=( const this_type& r )    
   1.242 -            {
   1.243 -                m_Begin  = r.begin(); 
   1.244 -                m_End    = r.end();
   1.245 -                //
   1.246 -                // remark: this need not necessarily be true, but it does no harm
   1.247 -                //
   1.248 -                singular = r.singular;
   1.249 -                return *this;
   1.250 -            }
   1.251 -            #endif
   1.252 -                
   1.253 -            template< class Iterator >
   1.254 -            iterator_range& operator=( const iterator_range<Iterator>& r )    
   1.255 -            {
   1.256 -                m_Begin  = r.begin(); 
   1.257 -                m_End    = r.end();
   1.258 -                //
   1.259 -                // remark: this need not necessarily be true, but it does no harm
   1.260 -                //
   1.261 -                singular = r.empty();
   1.262 -                return *this;
   1.263 -            }
   1.264 -                                      
   1.265 -            template< class ForwardRange >
   1.266 -            iterator_range& operator=( ForwardRange& r )
   1.267 -            {
   1.268 -                m_Begin  = impl::adl_begin( r ); 
   1.269 -                m_End    = impl::adl_end( r );
   1.270 -                singular = false;
   1.271 -                return *this;
   1.272 -            }
   1.273 -
   1.274 -            template< class ForwardRange >
   1.275 -            iterator_range& operator=( const ForwardRange& r )
   1.276 -            {
   1.277 -                m_Begin  = impl::adl_begin( r ); 
   1.278 -                m_End    = impl::adl_end( r );
   1.279 -                singular = false;
   1.280 -                return *this;
   1.281 -            }
   1.282 -
   1.283 -            IteratorT begin() const 
   1.284 -            { 
   1.285 -                return m_Begin; 
   1.286 -            }
   1.287 -
   1.288 -            IteratorT end() const 
   1.289 -            { 
   1.290 -                return m_End; 
   1.291 -            } 
   1.292 -
   1.293 -            size_type size() const
   1.294 -            { 
   1.295 -                if( singular )
   1.296 -                    return 0;
   1.297 -
   1.298 -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
   1.299 -                return std::distance<IteratorT>( m_Begin, m_End );
   1.300 -#else                
   1.301 -                return std::distance( m_Begin, m_End );
   1.302 -#endif                
   1.303 -            }
   1.304 -            
   1.305 -            bool empty() const
   1.306 -            {
   1.307 -                if( singular )
   1.308 -                    return true;
   1.309 -                
   1.310 -                return m_Begin == m_End;
   1.311 -            }
   1.312 -
   1.313 -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))  
   1.314 -            operator bool() const
   1.315 -            {
   1.316 -                return !empty();
   1.317 -            }                                    
   1.318 -#else            
   1.319 -            typedef iterator (iterator_range::*unspecified_bool_type) () const;
   1.320 -            operator unspecified_bool_type() const
   1.321 -            {
   1.322 -                return empty() ? 0: &iterator_range::end;
   1.323 -            }
   1.324 -#endif
   1.325 -
   1.326 -            bool equal( const iterator_range& r ) const
   1.327 -            {
   1.328 -                return singular == r.singular && m_Begin == r.m_Begin && m_End == r.m_End;
   1.329 -            }
   1.330 -
   1.331 -
   1.332 -#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   1.333 -
   1.334 -            bool operator==( const iterator_range& r ) const
   1.335 -            {
   1.336 -                return iterator_range_detail::equal( *this, r );
   1.337 -            }
   1.338 -
   1.339 -            bool operator!=( const iterator_range& r ) const
   1.340 -            {
   1.341 -                return !operator==(r);
   1.342 -            }
   1.343 -
   1.344 -           bool operator<( const iterator_range& r ) const
   1.345 -           {
   1.346 -                return iterator_range_detail::less_than( *this, r );
   1.347 -           }
   1.348 -
   1.349 -#endif            
   1.350 -
   1.351 -        public: // convenience
   1.352 -           reference front() const
   1.353 -           {
   1.354 -               BOOST_ASSERT( !empty() );
   1.355 -               return *m_Begin;
   1.356 -           }
   1.357 -    
   1.358 -           reference back() const
   1.359 -           {
   1.360 -               BOOST_ASSERT( !empty() );
   1.361 -               IteratorT last( m_End );
   1.362 -               return *--last;
   1.363 -           }
   1.364 -    
   1.365 -           reference operator[]( size_type sz ) const
   1.366 -           {
   1.367 -               //BOOST_STATIC_ASSERT( is_random_access );
   1.368 -               BOOST_ASSERT( sz < size() );
   1.369 -               return m_Begin[sz];
   1.370 -           }
   1.371 -
   1.372 -           iterator_range& advance_begin( difference_type n )
   1.373 -           {
   1.374 -               std::advance( m_Begin, n );
   1.375 -               return *this;
   1.376 -           }
   1.377 -           
   1.378 -           iterator_range& advance_end( difference_type n )
   1.379 -           {
   1.380 -               std::advance( m_End, n );
   1.381 -               return *this;
   1.382 -           }
   1.383 -           
   1.384 -        private:
   1.385 -            // begin and end iterators
   1.386 -            IteratorT m_Begin;
   1.387 -            IteratorT m_End;
   1.388 -            bool      singular;
   1.389 -        };
   1.390 -
   1.391 -//  iterator range free-standing operators ---------------------------//
   1.392 -
   1.393 -#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   1.394 -#else
   1.395 -        template< class Iterator >
   1.396 -        inline bool empty( const iterator_range<Iterator>& r )
   1.397 -        {
   1.398 -            //
   1.399 -            // this will preserve the well-defined empty() even 
   1.400 -            // though 'r' is singular.
   1.401 -            //
   1.402 -            return r.empty();
   1.403 -        }
   1.404 -#endif
   1.405 -
   1.406 -#ifndef BOOST_OLD_IOSTREAMS   
   1.407 -
   1.408 -        //! iterator_range output operator
   1.409 -        /*!
   1.410 -            Output the range to an ostream. Elements are outputed
   1.411 -            in a sequence without separators.
   1.412 -        */
   1.413 -        template< typename IteratorT, typename Elem, typename Traits >
   1.414 -        inline std::basic_ostream<Elem,Traits>& operator<<( 
   1.415 -                    std::basic_ostream<Elem, Traits>& Os,
   1.416 -                    const iterator_range<IteratorT>& r )
   1.417 -        {
   1.418 -            std::copy( r.begin(), r.end(), 
   1.419 -                       std::ostream_iterator< BOOST_DEDUCED_TYPENAME 
   1.420 -                                            iterator_value<IteratorT>::type, 
   1.421 -                                              Elem, Traits>(Os) );
   1.422 -            return Os;
   1.423 -        }
   1.424 -
   1.425 -#else
   1.426 -
   1.427 -        //! iterator_range output operator
   1.428 -        /*!
   1.429 -            Output the range to an ostream. Elements are outputed
   1.430 -            in a sequence without separators.
   1.431 -        */
   1.432 -        template< typename IteratorT >
   1.433 -        inline std::ostream& operator<<( 
   1.434 -                    std::ostream& Os,
   1.435 -                    const iterator_range<IteratorT>& r )
   1.436 -        {
   1.437 -            std::copy( r.begin(), r.end(), std::ostream_iterator<char>(Os));
   1.438 -            return Os;
   1.439 -        }
   1.440 -
   1.441 -#endif
   1.442 -
   1.443 -        /////////////////////////////////////////////////////////////////////
   1.444 -        // comparison operators
   1.445 -        /////////////////////////////////////////////////////////////////////
   1.446 -
   1.447 -        template< class IteratorT, class ForwardRange >
   1.448 -        inline bool operator==( const ForwardRange& l, 
   1.449 -                                const iterator_range<IteratorT>& r )
   1.450 -        {
   1.451 -            return iterator_range_detail::equal( l, r );
   1.452 -        }
   1.453 -
   1.454 -        template< class IteratorT, class ForwardRange >
   1.455 -        inline bool operator!=( const ForwardRange& l, 
   1.456 -                                const iterator_range<IteratorT>& r )
   1.457 -        {
   1.458 -            return !iterator_range_detail::equal( l, r );
   1.459 -        }
   1.460 -
   1.461 -        template< class IteratorT, class ForwardRange >
   1.462 -        inline bool operator<( const ForwardRange& l, 
   1.463 -                               const iterator_range<IteratorT>& r )
   1.464 -        {
   1.465 -            return iterator_range_detail::less_than( l, r );
   1.466 -        }
   1.467 -
   1.468 -#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   1.469 -#else
   1.470 -        template< class Iterator1T, class Iterator2T >
   1.471 -        inline bool operator==( const iterator_range<Iterator1T>& l, 
   1.472 -                                const iterator_range<Iterator2T>& r )
   1.473 -        {
   1.474 -            return iterator_range_detail::equal( l, r );
   1.475 -        }
   1.476 -
   1.477 -        template< class IteratorT, class ForwardRange >
   1.478 -        inline bool operator==( const iterator_range<IteratorT>& l, 
   1.479 -                                const ForwardRange& r )
   1.480 -        {
   1.481 -            return iterator_range_detail::equal( l, r );
   1.482 -        }
   1.483 -
   1.484 -
   1.485 -        template< class Iterator1T, class Iterator2T >
   1.486 -        inline bool operator!=( const iterator_range<Iterator1T>& l, 
   1.487 -                                const iterator_range<Iterator2T>& r )
   1.488 -        {
   1.489 -            return !iterator_range_detail::equal( l, r );
   1.490 -        }
   1.491 -        
   1.492 -        template< class IteratorT, class ForwardRange >
   1.493 -        inline bool operator!=( const iterator_range<IteratorT>& l, 
   1.494 -                                const ForwardRange& r )
   1.495 -        {
   1.496 -            return !iterator_range_detail::equal( l, r );
   1.497 -        }
   1.498 -
   1.499 -        
   1.500 -        template< class Iterator1T, class Iterator2T >
   1.501 -        inline bool operator<( const iterator_range<Iterator1T>& l, 
   1.502 -                               const iterator_range<Iterator2T>& r )
   1.503 -        {
   1.504 -            return iterator_range_detail::less_than( l, r );
   1.505 -        }
   1.506 -
   1.507 -        template< class IteratorT, class ForwardRange >
   1.508 -        inline bool operator<( const iterator_range<IteratorT>& l, 
   1.509 -                               const ForwardRange& r )
   1.510 -        {            
   1.511 -            return iterator_range_detail::less_than( l, r );
   1.512 -        }
   1.513 -
   1.514 -#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   1.515 -                    
   1.516 -//  iterator range utilities -----------------------------------------//
   1.517 -
   1.518 -        //! iterator_range construct helper 
   1.519 -        /*!
   1.520 -            Construct an \c iterator_range from a pair of iterators
   1.521 -
   1.522 -            \param Begin A begin iterator
   1.523 -            \param End An end iterator
   1.524 -            \return iterator_range object
   1.525 -        */
   1.526 -        template< typename IteratorT >
   1.527 -        inline iterator_range< IteratorT > 
   1.528 -        make_iterator_range( IteratorT Begin, IteratorT End ) 
   1.529 -        {   
   1.530 -            return iterator_range<IteratorT>( Begin, End );
   1.531 -        }
   1.532 -                     
   1.533 -#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   1.534 -
   1.535 -        template< typename Range >
   1.536 -        inline iterator_range< BOOST_DEDUCED_TYPENAME range_result_iterator<Range>::type >
   1.537 -        make_iterator_range( Range& r ) 
   1.538 -        {   
   1.539 -            return iterator_range< BOOST_DEDUCED_TYPENAME range_result_iterator<Range>::type >
   1.540 -                ( boost::begin( r ), boost::end( r ) );
   1.541 -        }
   1.542 -        
   1.543 -#else
   1.544 -        //! iterator_range construct helper
   1.545 -        /*!
   1.546 -            Construct an \c iterator_range from a \c Range containing the begin
   1.547 -            and end iterators.
   1.548 -        */
   1.549 -        template< class ForwardRange >
   1.550 -        inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type >
   1.551 -        make_iterator_range( ForwardRange& r ) 
   1.552 -        {   
   1.553 -           return iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type >
   1.554 -                ( r, iterator_range_detail::range_tag() );
   1.555 -        }
   1.556 -
   1.557 -        template< class ForwardRange >
   1.558 -        inline iterator_range< BOOST_DEDUCED_TYPENAME range_const_iterator<ForwardRange>::type >
   1.559 -        make_iterator_range( const ForwardRange& r ) 
   1.560 -        {   
   1.561 -           return iterator_range< BOOST_DEDUCED_TYPENAME range_const_iterator<ForwardRange>::type >
   1.562 -                ( r, iterator_range_detail::const_range_tag() );
   1.563 -        }
   1.564 -
   1.565 -#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   1.566 -
   1.567 -        namespace iterator_range_detail
   1.568 -        {    
   1.569 -            template< class Range >
   1.570 -            inline iterator_range< BOOST_DEDUCED_TYPENAME range_result_iterator<Range>::type >
   1.571 -            make_range_impl( Range& r, 
   1.572 -                             BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_begin,
   1.573 -                             BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_end )
   1.574 -            {
   1.575 -                if( advance_begin == 0 && advance_end == 0 )
   1.576 -                    return make_iterator_range( r );
   1.577 -
   1.578 -                BOOST_DEDUCED_TYPENAME range_result_iterator<Range>::type 
   1.579 -                    new_begin = boost::begin( r ),
   1.580 -                    new_end   = boost::end( r );
   1.581 -                std::advance( new_begin, advance_begin );
   1.582 -                std::advance( new_end, advance_end );
   1.583 -                return make_iterator_range( new_begin, new_end );
   1.584 -            }
   1.585 -        }
   1.586 -        
   1.587 -#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   1.588 -
   1.589 -        template< class Range >
   1.590 -        inline iterator_range< BOOST_DEDUCED_TYPENAME range_result_iterator<Range>::type >
   1.591 -        make_iterator_range( Range& r, 
   1.592 -                    BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_begin,
   1.593 -                    BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_end )
   1.594 -        {
   1.595 -            //BOOST_ASSERT( advance_begin - advance_end <= size(r) && "creating invalid range" );
   1.596 -            return iterator_range_detail::make_range_impl( r, advance_begin, advance_end );
   1.597 -        }
   1.598 -
   1.599 -#else
   1.600 -
   1.601 -        template< class Range >
   1.602 -        inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<Range>::type >
   1.603 -        make_iterator_range( Range& r, 
   1.604 -                    BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_begin,
   1.605 -                    BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_end )
   1.606 -        {
   1.607 -            //BOOST_ASSERT( advance_begin - advance_end <= size(r) && "creating invalid range" );
   1.608 -            return iterator_range_detail::make_range_impl( r, advance_begin, advance_end );
   1.609 -        }
   1.610 -
   1.611 -        template< class Range >
   1.612 -        inline iterator_range< BOOST_DEDUCED_TYPENAME range_const_iterator<Range>::type >
   1.613 -        make_iterator_range( const Range& r, 
   1.614 -                    BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_begin,
   1.615 -                    BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_end )
   1.616 -        {
   1.617 -            //BOOST_ASSERT( advance_begin - advance_end <= size(r) && "creating invalid range" );
   1.618 -            return iterator_range_detail::make_range_impl( r, advance_begin, advance_end );
   1.619 -        }
   1.620 -
   1.621 -#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   1.622 -
   1.623 -        //! copy a range into a sequence
   1.624 -        /*!
   1.625 -            Construct a new sequence of the specified type from the elements
   1.626 -            in the given range
   1.627 -
   1.628 -            \param Range An input range
   1.629 -            \return New sequence
   1.630 -        */
   1.631 -        template< typename SeqT, typename Range >
   1.632 -        inline SeqT copy_range( const Range& r )
   1.633 -        {
   1.634 -            return SeqT( boost::begin( r ), boost::end( r ) );
   1.635 -        }
   1.636 -
   1.637 -} // namespace 'boost'
   1.638 -
   1.639 -#undef BOOST_OLD_IOSTREAMS
   1.640 -
   1.641 -#endif
   1.642 +#endif // BOOST_MPL_ITERATOR_RANGE_HPP_INCLUDED