1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/boost/range/end.hpp Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,201 @@
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_END_HPP
1.15 +#define BOOST_RANGE_END_HPP
1.16 +
1.17 +#if defined(_MSC_VER) && (_MSC_VER >= 1200)
1.18 +# pragma once
1.19 +#endif
1.20 +
1.21 +#include <boost/type_traits/remove_const.hpp>
1.22 +#include <boost/range/config.hpp>
1.23 +
1.24 +#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
1.25 +#include <boost/range/detail/end.hpp>
1.26 +#else
1.27 +
1.28 +#include <boost/range/detail/implementation_help.hpp>
1.29 +#include <boost/range/iterator.hpp>
1.30 +#include <boost/range/const_iterator.hpp>
1.31 +
1.32 +namespace boost
1.33 +{
1.34 +
1.35 +#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
1.36 + !BOOST_WORKAROUND(__GNUC__, < 3) \
1.37 + /**/
1.38 +namespace range_detail
1.39 +{
1.40 +#endif
1.41 +
1.42 + //////////////////////////////////////////////////////////////////////
1.43 + // primary template
1.44 + //////////////////////////////////////////////////////////////////////
1.45 +
1.46 + template< typename C >
1.47 + inline BOOST_DEDUCED_TYPENAME range_const_iterator<C>::type
1.48 + boost_range_end( const C& c )
1.49 + {
1.50 + return c.end();
1.51 + }
1.52 +
1.53 + template< typename C >
1.54 + inline BOOST_DEDUCED_TYPENAME range_iterator<
1.55 + typename remove_const<C>::type >::type
1.56 + boost_range_end( C& c )
1.57 + {
1.58 + return c.end();
1.59 + }
1.60 +
1.61 + //////////////////////////////////////////////////////////////////////
1.62 + // pair
1.63 + //////////////////////////////////////////////////////////////////////
1.64 +
1.65 + template< typename Iterator >
1.66 + inline Iterator boost_range_end( const std::pair<Iterator,Iterator>& p )
1.67 + {
1.68 + return p.second;
1.69 + }
1.70 +
1.71 + template< typename Iterator >
1.72 + inline Iterator boost_range_end( std::pair<Iterator,Iterator>& p )
1.73 + {
1.74 + return p.second;
1.75 + }
1.76 +
1.77 + //////////////////////////////////////////////////////////////////////
1.78 + // array
1.79 + //////////////////////////////////////////////////////////////////////
1.80 +
1.81 + template< typename T, std::size_t sz >
1.82 + inline const T* boost_range_end( const T (&array)[sz] )
1.83 + {
1.84 + return range_detail::array_end<T,sz>( array );
1.85 + }
1.86 +
1.87 + template< typename T, std::size_t sz >
1.88 + inline T* boost_range_end( T (&array)[sz] )
1.89 + {
1.90 + return range_detail::array_end<T,sz>( array );
1.91 + }
1.92 +
1.93 + //////////////////////////////////////////////////////////////////////
1.94 + // string
1.95 + //////////////////////////////////////////////////////////////////////
1.96 +
1.97 +#if 1 || BOOST_WORKAROUND(__MWERKS__, <= 0x3204 ) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
1.98 +// CW up to 9.3 and borland have troubles with function ordering
1.99 + inline char* boost_range_end( char* s )
1.100 + {
1.101 + return range_detail::str_end( s );
1.102 + }
1.103 +
1.104 + inline wchar_t* boost_range_end( wchar_t* s )
1.105 + {
1.106 + return range_detail::str_end( s );
1.107 + }
1.108 +
1.109 + inline const char* boost_range_end( const char* s )
1.110 + {
1.111 + return range_detail::str_end( s );
1.112 + }
1.113 +
1.114 + inline const wchar_t* boost_range_end( const wchar_t* s )
1.115 + {
1.116 + return range_detail::str_end( s );
1.117 + }
1.118 +#else
1.119 + inline char* boost_range_end( char*& s )
1.120 + {
1.121 + return range_detail::str_end( s );
1.122 + }
1.123 +
1.124 + inline wchar_t* boost_range_end( wchar_t*& s )
1.125 + {
1.126 + return range_detail::str_end( s );
1.127 + }
1.128 +
1.129 + inline const char* boost_range_end( const char*& s )
1.130 + {
1.131 + return range_detail::str_end( s );
1.132 + }
1.133 +
1.134 + inline const wchar_t* boost_range_end( const wchar_t*& s )
1.135 + {
1.136 + return range_detail::str_end( s );
1.137 + }
1.138 +#endif
1.139 +
1.140 +#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
1.141 + !BOOST_WORKAROUND(__GNUC__, < 3) \
1.142 + /**/
1.143 +} // namespace 'range_detail'
1.144 +#endif
1.145 +
1.146 +template< class T >
1.147 +inline BOOST_DEDUCED_TYPENAME range_iterator<
1.148 + typename remove_const<T>::type >::type end( T& r )
1.149 +{
1.150 +#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
1.151 + !BOOST_WORKAROUND(__GNUC__, < 3) \
1.152 + /**/
1.153 + using namespace range_detail;
1.154 +#endif
1.155 + return boost_range_end( r );
1.156 +}
1.157 +
1.158 +template< class T >
1.159 +inline BOOST_DEDUCED_TYPENAME range_const_iterator<T>::type end( const T& r )
1.160 +{
1.161 +#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
1.162 + !BOOST_WORKAROUND(__GNUC__, < 3) \
1.163 + /**/
1.164 + using namespace range_detail;
1.165 +#endif
1.166 + return boost_range_end( r );
1.167 +}
1.168 +
1.169 +
1.170 +
1.171 +#if BOOST_WORKAROUND(__MWERKS__, <= 0x3003 ) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
1.172 +// BCB and CW are not able to overload pointer when class overloads are also available.
1.173 +template<>
1.174 +inline range_const_iterator<const char*>::type end<const char*>( const char*& r )
1.175 +{
1.176 + return range_detail::str_end( r );
1.177 +}
1.178 +
1.179 +template<>
1.180 +inline range_const_iterator<const wchar_t*>::type end<const wchar_t*>( const wchar_t*& r )
1.181 +{
1.182 + return range_detail::str_end( r );
1.183 +}
1.184 +
1.185 +#endif
1.186 +
1.187 +} // namespace 'boost'
1.188 +
1.189 +
1.190 +
1.191 +#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
1.192 +
1.193 +
1.194 +namespace boost
1.195 +{
1.196 + template< class T >
1.197 + inline BOOST_DEDUCED_TYPENAME range_const_iterator<T>::type
1.198 + const_end( const T& r )
1.199 + {
1.200 + return boost::end( r );
1.201 + }
1.202 +}
1.203 +
1.204 +#endif