update of new concepts, and replacement of range_size<T>::type with range_difference<T>::type throughut the library

[SVN r40965]
This commit is contained in:
Thorsten Jørgen Ottosen
2007-11-09 13:30:57 +00:00
parent 1509d5603b
commit 2605b9ee45
4 changed files with 34 additions and 58 deletions

View File

@ -73,7 +73,7 @@ namespace boost
template< class Left, class Right >
inline bool equal( const Left& l, const Right& r )
{
typedef BOOST_DEDUCED_TYPENAME boost::range_size<Left>::type sz_type;
typedef BOOST_DEDUCED_TYPENAME boost::range_difference<Left>::type sz_type;
sz_type l_size = boost::size( l ),
r_size = boost::size( r );
@ -166,20 +166,7 @@ namespace boost
, singular( true )
#endif
{ }
/*
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
iterator_range( this_type r ) :
: m_Begin(r.begin()), m_End(r.end())
{ }
this_type& operator=( this_type r )
{
m_Begin = r.begin();
m_End = r.end();
return *this;
}
#endif
*/
//! Constructor from a pair of iterators
template< class Iterator >
iterator_range( Iterator Begin, Iterator End ) :
@ -283,7 +270,7 @@ namespace boost
return m_End;
}
size_type size() const
difference_type size() const
{
BOOST_ASSERT( !is_singular() );
return m_End - m_Begin;
@ -351,9 +338,9 @@ namespace boost
return *--last;
}
reference operator[]( size_type at ) const
reference operator[]( difference_type at ) const
{
BOOST_ASSERT( at < size() );
BOOST_ASSERT( at >= 0 && at < size() );
return m_Begin[at];
}
@ -362,9 +349,9 @@ namespace boost
// fails because it returns by reference. Therefore
// operator()() is provided for these cases.
//
value_type operator()( size_type at ) const
value_type operator()( difference_type at ) const
{
BOOST_ASSERT( at < size() );
BOOST_ASSERT( at >= 0 && at < size() );
return m_Begin[at];
}