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

@ -17,14 +17,17 @@
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/size_type.hpp>
#include <boost/range/difference_type.hpp>
#include <boost/assert.hpp>
namespace boost
{
template< class T >
inline BOOST_DEDUCED_TYPENAME range_size<T>::type size( const T& r )
inline BOOST_DEDUCED_TYPENAME range_difference<T>::type size( const T& r )
{
BOOST_ASSERT( (boost::end( r ) - boost::begin( r )) >= 0 &&
"reachability invariant broken!" );
return boost::end( r ) - boost::begin( r );
}