merge from 1.33.1

[SVN r31968]
This commit is contained in:
Thorsten Jørgen Ottosen
2005-12-09 22:22:32 +00:00
parent a2b6c3f5ec
commit c08103b1c5
13 changed files with 1005 additions and 466 deletions

View File

@ -15,6 +15,7 @@
# pragma once
#endif
#include <boost/type_traits/remove_const.hpp>
#include <boost/range/config.hpp>
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
@ -46,7 +47,8 @@ namespace range_detail
}
template< typename C >
inline BOOST_DEDUCED_TYPENAME range_iterator<C>::type
inline BOOST_DEDUCED_TYPENAME range_iterator<
typename remove_const<C>::type >::type
boost_range_begin( C& c )
{
return c.begin();
@ -140,7 +142,8 @@ namespace range_detail
template< class T >
inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type begin( T& r )
inline BOOST_DEDUCED_TYPENAME range_iterator<
typename remove_const<T>::type >::type begin( T& r )
{
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
!BOOST_WORKAROUND(__GNUC__, < 3) \

View File

@ -16,12 +16,25 @@
#endif
#include <boost/range/config.hpp>
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#include <boost/range/detail/difference_type.hpp>
#else
#include <boost/range/const_iterator.hpp>
#include <boost/iterator/iterator_traits.hpp>
namespace boost
{
template< class T >
struct range_difference
{
typedef BOOST_DEDUCED_TYPENAME iterator_difference<
BOOST_DEDUCED_TYPENAME range_const_iterator<T>::type >::type
type;
};
}
//#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
//#include <boost/range/detail/difference_type.hpp>
//#else
/*
#include <cstddef>
#include <utility>
@ -30,13 +43,13 @@ namespace boost
//////////////////////////////////////////////////////////////////////////
// default
//////////////////////////////////////////////////////////////////////////
template< typename C >
struct range_difference
{
typedef BOOST_DEDUCED_TYPENAME C::difference_type type;
};
//////////////////////////////////////////////////////////////////////////
// pair
//////////////////////////////////////////////////////////////////////////
@ -44,14 +57,14 @@ namespace boost
template< typename Iterator >
struct range_difference< std::pair<Iterator,Iterator> >
{
typedef BOOST_DEDUCED_TYPENAME
typedef BOOST_DEDUCED_TYPENAME
iterator_difference<Iterator>::type type;
};
template< typename Iterator >
struct range_difference< const std::pair<Iterator,Iterator> >
{
typedef BOOST_DEDUCED_TYPENAME
typedef BOOST_DEDUCED_TYPENAME
iterator_difference<Iterator>::type type;
};
@ -127,5 +140,6 @@ namespace boost
} // namespace boost
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
*/
#endif

View File

@ -15,6 +15,7 @@
# pragma once
#endif
#include <boost/type_traits/remove_const.hpp>
#include <boost/range/config.hpp>
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
@ -25,34 +26,35 @@
#include <boost/range/iterator.hpp>
#include <boost/range/const_iterator.hpp>
namespace boost
namespace boost
{
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
!BOOST_WORKAROUND(__GNUC__, < 3) \
/**/
/**/
namespace range_detail
{
#endif
#endif
//////////////////////////////////////////////////////////////////////
// primary template
//////////////////////////////////////////////////////////////////////
template< typename C >
inline BOOST_DEDUCED_TYPENAME range_const_iterator<C>::type
boost_range_end( const C& c )
{
return c.end();
}
template< typename C >
inline BOOST_DEDUCED_TYPENAME range_iterator<C>::type
inline BOOST_DEDUCED_TYPENAME range_iterator<
typename remove_const<C>::type >::type
boost_range_end( C& c )
{
return c.end();
}
//////////////////////////////////////////////////////////////////////
// pair
//////////////////////////////////////////////////////////////////////
@ -62,13 +64,13 @@ namespace range_detail
{
return p.second;
}
template< typename Iterator >
inline Iterator boost_range_end( std::pair<Iterator,Iterator>& p )
{
return p.second;
}
//////////////////////////////////////////////////////////////////////
// array
//////////////////////////////////////////////////////////////////////
@ -76,13 +78,13 @@ namespace range_detail
template< typename T, std::size_t sz >
inline const T* boost_range_end( const T (&array)[sz] )
{
return range_detail::array_end<T,sz>( array );
return range_detail::array_end<T,sz>( array );
}
template< typename T, std::size_t sz >
inline T* boost_range_end( T (&array)[sz] )
{
return range_detail::array_end<T,sz>( array );
return range_detail::array_end<T,sz>( array );
}
//////////////////////////////////////////////////////////////////////
@ -134,18 +136,19 @@ namespace range_detail
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
!BOOST_WORKAROUND(__GNUC__, < 3) \
/**/
/**/
} // namespace 'range_detail'
#endif
template< class T >
inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type end( T& r )
inline BOOST_DEDUCED_TYPENAME range_iterator<
typename remove_const<T>::type >::type end( T& r )
{
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
!BOOST_WORKAROUND(__GNUC__, < 3) \
/**/
using namespace range_detail;
#endif
#endif
return boost_range_end( r );
}
@ -156,7 +159,7 @@ inline BOOST_DEDUCED_TYPENAME range_const_iterator<T>::type end( const T& r )
!BOOST_WORKAROUND(__GNUC__, < 3) \
/**/
using namespace range_detail;
#endif
#endif
return boost_range_end( r );
}

View File

@ -26,7 +26,7 @@ namespace boost
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template< class C >
inline BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type
inline BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type
rbegin( C& c )
{
return BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type( end( c ) );
@ -35,16 +35,18 @@ rbegin( C& c )
#else
template< class C >
inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<
typename remove_const<C>::type >::type
rbegin( C& c )
{
typedef BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
typedef BOOST_DEDUCED_TYPENAME range_reverse_iterator<
typename remove_const<C>::type >::type
iter_type;
return iter_type( end( c ) );
}
template< class C >
inline BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type
inline BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type
rbegin( const C& c )
{
typedef BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type

View File

@ -22,29 +22,31 @@
namespace boost
{
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template< class C >
inline BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type
inline BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type
rend( C& c )
{
return BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type( begin( c ) );
}
#else
template< class C >
inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<
typename remove_const<C>::type >::type
rend( C& c )
{
typedef BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
typedef BOOST_DEDUCED_TYPENAME range_reverse_iterator<
typename remove_const<C>::type >::type
iter_type;
return iter_type( begin( c ) );
}
template< class C >
inline BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type
inline BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type
rend( const C& c )
{
typedef BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type

View File

@ -16,6 +16,54 @@
#endif
#include <boost/range/config.hpp>
/*
#include <boost/range/difference_type.hpp>
namespace boost
{
namespace range_detail
{
template< class T >
struct add_unsigned;
template<>
struct add_unsigned<short>
{
typedef unsigned short type;
};
template<>
struct add_unsigned<int>
{
typedef unsigned int type;
};
template<>
struct add_unsigned<long>
{
typedef unsigned long type;
};
#ifdef BOOST_HAS_LONG_LONG
template<>
struct add_unsigned<long long>
{
typedef unsigned long long type;
};
#endif
}
template< class T >
struct range_size
{
typedef BOOST_DEDUCED_TYPENAME range_detail::add_unsigned<
BOOST_DEDUCED_TYPENAME range_difference<T>::type >::type
type;
};
}
*/
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#include <boost/range/detail/size_type.hpp>
@ -29,13 +77,13 @@ namespace boost
//////////////////////////////////////////////////////////////////////////
// default
//////////////////////////////////////////////////////////////////////////
template< typename C >
struct range_size
{
typedef BOOST_DEDUCED_TYPENAME C::size_type type;
};
//////////////////////////////////////////////////////////////////////////
// pair
//////////////////////////////////////////////////////////////////////////
@ -45,7 +93,7 @@ namespace boost
{
typedef std::size_t type;
};
template< typename Iterator >
struct range_size< const std::pair<Iterator,Iterator> >
{
@ -124,4 +172,5 @@ namespace boost
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#endif

View File

@ -16,12 +16,26 @@
#endif
#include <boost/range/config.hpp>
#include <boost/range/iterator.hpp>
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#include <boost/range/detail/value_type.hpp>
#else
#include <boost/iterator/iterator_traits.hpp>
namespace boost
{
template< class T >
struct range_value
{
typedef BOOST_DEDUCED_TYPENAME iterator_value<
BOOST_DEDUCED_TYPENAME range_iterator<T>::type >::type
type;
};
}
/*
#include <cstddef>
#include <utility>
@ -31,13 +45,13 @@ namespace boost
//////////////////////////////////////////////////////////////////////////
// default
//////////////////////////////////////////////////////////////////////////
template< typename C >
struct range_value
{
typedef BOOST_DEDUCED_TYPENAME C::value_type type;
};
//////////////////////////////////////////////////////////////////////////
// pair
//////////////////////////////////////////////////////////////////////////
@ -45,15 +59,15 @@ namespace boost
template< typename Iterator >
struct range_value< std::pair<Iterator,Iterator> >
{
typedef BOOST_DEDUCED_TYPENAME
typedef BOOST_DEDUCED_TYPENAME
iterator_value<Iterator>::type type;
};
template< typename Iterator >
struct range_value< const std::pair<Iterator,Iterator> >
{
typedef BOOST_DEDUCED_TYPENAME
typedef BOOST_DEDUCED_TYPENAME
iterator_value<Iterator>::type type;
};
@ -72,7 +86,7 @@ namespace boost
{
typedef const T type;
};
//////////////////////////////////////////////////////////////////////////
// string
//////////////////////////////////////////////////////////////////////////
@ -126,7 +140,7 @@ namespace boost
};
} // namespace boost
*/
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#endif