forked from boostorg/range
Merged revisions 40922-40969 via svnmerge from
https://svn.boost.org/svn/boost/trunk ........ r40923 | eric_niebler | 2007-11-07 22:48:08 -0800 (Wed, 07 Nov 2007) | 1 line fix errors and warnings on msvc-9 ........ r40924 | chris_kohlhoff | 2007-11-07 23:52:49 -0800 (Wed, 07 Nov 2007) | 2 lines Fix timer stalls. ........ r40925 | johnmaddock | 2007-11-08 01:38:22 -0800 (Thu, 08 Nov 2007) | 1 line Fixed license text. ........ r40926 | bemandawes | 2007-11-08 04:35:50 -0800 (Thu, 08 Nov 2007) | 1 line Borland appends newline, so just check text ........ r40927 | johnmaddock | 2007-11-08 04:39:58 -0800 (Thu, 08 Nov 2007) | 1 line Removed non-BSL files, updated and regenerated docs accordingly. ........ r40928 | bemandawes | 2007-11-08 05:01:23 -0800 (Thu, 08 Nov 2007) | 1 line Markup older Borland compilers that don't support enable_if ........ r40932 | bemandawes | 2007-11-08 06:25:09 -0800 (Thu, 08 Nov 2007) | 1 line Clarify comment ........ r40934 | joaquin | 2007-11-08 07:46:57 -0800 (Thu, 08 Nov 2007) | 1 line removed markup for a fixed failure of multi_index on vacpp ........ r40935 | nikiml | 2007-11-08 08:28:44 -0800 (Thu, 08 Nov 2007) | 1 line changed handle cast to downcast ........ r40936 | hljin | 2007-11-08 09:31:56 -0800 (Thu, 08 Nov 2007) | 1 line GIL: added missing standard C++ header files ........ r40937 | hljin | 2007-11-08 09:35:37 -0800 (Thu, 08 Nov 2007) | 1 line GIL: added namespace prefix to avoid confusion ........ r40938 | danieljames | 2007-11-08 10:04:12 -0800 (Thu, 08 Nov 2007) | 3 lines Remove the <small> from the copyright footer, because it was causing the markup to be invalid. ........ r40939 | johnmaddock | 2007-11-08 10:05:28 -0800 (Thu, 08 Nov 2007) | 1 line Applied fix from http://svn.boost.org/trac/boost/ticket/1023. ........ r40956 | vladimir_prus | 2007-11-09 00:26:47 -0800 (Fri, 09 Nov 2007) | 1 line Don't use toolset.register ........ r40957 | vladimir_prus | 2007-11-09 00:30:27 -0800 (Fri, 09 Nov 2007) | 2 lines Remove toolset.register. ........ r40958 | speedsnail | 2007-11-09 00:31:45 -0800 (Fri, 09 Nov 2007) | 2 lines Force static linking for toolsets mingw and boorland. ........ r40959 | speedsnail | 2007-11-09 01:28:29 -0800 (Fri, 09 Nov 2007) | 1 line Reverted the previous commit, until I find a better solution... ........ r40960 | johnmaddock | 2007-11-09 01:54:43 -0800 (Fri, 09 Nov 2007) | 1 line Still trying to get the Solaris error rates correct.... ........ r40961 | johnmaddock | 2007-11-09 01:59:37 -0800 (Fri, 09 Nov 2007) | 1 line Trivial fix for issue #647. ........ r40962 | nesotto | 2007-11-09 02:27:42 -0800 (Fri, 09 Nov 2007) | 1 line major update wrt. new range concepts ........ r40963 | johnmaddock | 2007-11-09 03:01:45 -0800 (Fri, 09 Nov 2007) | 1 line Improved error messages and added tentative fixes for HP Tru64: the compiler appears to store constants that should underflow to zero as a small non-zero values which messes up the logic used in the test cases. ........ r40964 | nesotto | 2007-11-09 05:13:06 -0800 (Fri, 09 Nov 2007) | 1 line minor editorial issue ........ r40965 | nesotto | 2007-11-09 05:30:57 -0800 (Fri, 09 Nov 2007) | 1 line update of new concepts, and replacement of range_size<T>::type with range_difference<T>::type throughut the library ........ r40966 | nesotto | 2007-11-09 05:31:43 -0800 (Fri, 09 Nov 2007) | 1 line minor tweaks to avoid warnings ... extension mechanism updated to follow new protocol ........ r40967 | schoepflin | 2007-11-09 06:25:44 -0800 (Fri, 09 Nov 2007) | 1 line Added memory barriers to Tru64 atomic ops. ........ r40968 | nesotto | 2007-11-09 07:15:28 -0800 (Fri, 09 Nov 2007) | 1 line improved reference ........ r40969 | johnmaddock | 2007-11-09 08:57:42 -0800 (Fri, 09 Nov 2007) | 1 line Added needed macro suppression to use of isfinite. ........ [SVN r40970]
This commit is contained in:
@@ -13,8 +13,8 @@
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/iterator/iterator_concepts.hpp>
|
||||
#include <boost/range/functions.hpp>
|
||||
#include <boost/range/metafunctions.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
|
||||
/*!
|
||||
* \file
|
||||
@@ -57,10 +57,10 @@ namespace boost {
|
||||
|
||||
//! Check if a type T models the SinglePassRange range concept.
|
||||
template<typename T>
|
||||
struct SinglePassRangeConcept {
|
||||
typedef typename range_value<T>::type range_value;
|
||||
typedef typename range_iterator<T>::type range_iterator;
|
||||
//typedef typename range_iterator<const T>::type range_const_iterator;
|
||||
struct SinglePassRangeConcept
|
||||
{
|
||||
typedef typename range_iterator<T const>::type range_const_iterator;
|
||||
typedef typename range_iterator<T>::type range_iterator;
|
||||
|
||||
void constraints()
|
||||
{
|
||||
@@ -71,23 +71,24 @@ namespace boost {
|
||||
>();
|
||||
i = boost::begin(a);
|
||||
i = boost::end(a);
|
||||
b = boost::empty(a);
|
||||
const_constraints(a);
|
||||
}
|
||||
|
||||
void const_constraints(const T& a)
|
||||
{
|
||||
//ci = boost::begin(a);
|
||||
//ci = boost::end(a);
|
||||
ci = boost::begin(a);
|
||||
ci = boost::end(a);
|
||||
}
|
||||
T a;
|
||||
range_iterator i;
|
||||
range_const_iterator ci;
|
||||
bool b;
|
||||
};
|
||||
|
||||
//! Check if a type T models the ForwardRange range concept.
|
||||
template<typename T>
|
||||
struct ForwardRangeConcept {
|
||||
typedef typename range_difference<T>::type range_difference;
|
||||
struct ForwardRangeConcept
|
||||
{
|
||||
void constraints()
|
||||
{
|
||||
function_requires<
|
||||
@@ -103,8 +104,8 @@ namespace boost {
|
||||
|
||||
//! Check if a type T models the BidirectionalRange range concept.
|
||||
template<typename T>
|
||||
struct BidirectionalRangeConcept {
|
||||
typedef typename range_reverse_iterator<T>::type range_reverse_iterator;
|
||||
struct BidirectionalRangeConcept
|
||||
{
|
||||
void constraints()
|
||||
{
|
||||
function_requires<
|
||||
@@ -115,24 +116,13 @@ namespace boost {
|
||||
typename range_iterator<T>::type
|
||||
>
|
||||
>();
|
||||
i = boost::rbegin(a);
|
||||
i = boost::rend(a);
|
||||
const_constraints(a);
|
||||
}
|
||||
void const_constraints(const T& a)
|
||||
{
|
||||
//ci = boost::rbegin(a);
|
||||
//ci = boost::rend(a);
|
||||
}
|
||||
T a;
|
||||
range_reverse_iterator i;
|
||||
};
|
||||
|
||||
//! Check if a type T models the RandomAccessRange range concept.
|
||||
template<typename T>
|
||||
struct RandomAccessRangeConcept {
|
||||
typedef typename range_size<T>::type range_size;
|
||||
|
||||
struct RandomAccessRangeConcept
|
||||
{
|
||||
void constraints()
|
||||
{
|
||||
function_requires<
|
||||
@@ -143,12 +133,7 @@ namespace boost {
|
||||
typename range_iterator<T>::type
|
||||
>
|
||||
>();
|
||||
|
||||
s = boost::size(a);
|
||||
}
|
||||
|
||||
T a;
|
||||
range_size s;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace boost
|
||||
typedef BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type const_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME range_difference<ForwardRange>::type difference_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME range_size<ForwardRange>::type size_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME base::reference reference;
|
||||
|
||||
public:
|
||||
sub_range() : base()
|
||||
@@ -100,11 +101,11 @@ namespace boost
|
||||
const_iterator begin() const { return base::begin(); }
|
||||
iterator end() { return base::end(); }
|
||||
const_iterator end() const { return base::end(); }
|
||||
size_type size() const { return base::size(); }
|
||||
difference_type size() const { return base::size(); }
|
||||
|
||||
|
||||
public: // convenience
|
||||
value_type& front()
|
||||
reference front()
|
||||
{
|
||||
return base::front();
|
||||
}
|
||||
@@ -114,7 +115,7 @@ namespace boost
|
||||
return base::front();
|
||||
}
|
||||
|
||||
value_type& back()
|
||||
reference back()
|
||||
{
|
||||
return base::back();
|
||||
}
|
||||
@@ -124,12 +125,12 @@ namespace boost
|
||||
return base::back();
|
||||
}
|
||||
|
||||
value_type& operator[]( size_type sz )
|
||||
reference operator[]( difference_type sz )
|
||||
{
|
||||
return base::operator[](sz);
|
||||
}
|
||||
|
||||
const value_type& operator[]( size_type sz ) const
|
||||
const value_type& operator[]( difference_type sz ) const
|
||||
{
|
||||
return base::operator[](sz);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user