forked from boostorg/range
fixes for problems from Trac
[SVN r46345]
This commit is contained in:
6
include/boost/range/iterator_range.hpp
Executable file → Normal file
6
include/boost/range/iterator_range.hpp
Executable file → Normal file
@ -390,13 +390,15 @@ namespace boost
|
|||||||
bool singular;
|
bool singular;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
public:
|
public:
|
||||||
bool is_singular() const
|
bool is_singular() const
|
||||||
{
|
{
|
||||||
|
#ifndef NDEBUG
|
||||||
return singular;
|
return singular;
|
||||||
}
|
#else
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//
|
//
|
||||||
|
14
include/boost/range/sub_range.hpp
Executable file → Normal file
14
include/boost/range/sub_range.hpp
Executable file → Normal file
@ -23,6 +23,8 @@
|
|||||||
#include <boost/range/size_type.hpp>
|
#include <boost/range/size_type.hpp>
|
||||||
#include <boost/range/difference_type.hpp>
|
#include <boost/range/difference_type.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
#include <boost/type_traits/is_reference.hpp>
|
||||||
|
#include <boost/type_traits/remove_reference.hpp>
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
@ -42,6 +44,12 @@ namespace boost
|
|||||||
typedef BOOST_DEDUCED_TYPENAME range_size<ForwardRange>::type size_type;
|
typedef BOOST_DEDUCED_TYPENAME range_size<ForwardRange>::type size_type;
|
||||||
typedef BOOST_DEDUCED_TYPENAME base::reference reference;
|
typedef BOOST_DEDUCED_TYPENAME base::reference reference;
|
||||||
|
|
||||||
|
public: // for return value of front/back
|
||||||
|
typedef BOOST_DEDUCED_TYPENAME
|
||||||
|
boost::mpl::if_< boost::is_reference<reference>,
|
||||||
|
const BOOST_DEDUCED_TYPENAME boost::remove_reference<reference>::type&,
|
||||||
|
reference >::type const_reference;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
sub_range() : base()
|
sub_range() : base()
|
||||||
{ }
|
{ }
|
||||||
@ -112,7 +120,7 @@ namespace boost
|
|||||||
return base::front();
|
return base::front();
|
||||||
}
|
}
|
||||||
|
|
||||||
const value_type& front() const
|
const_reference front() const
|
||||||
{
|
{
|
||||||
return base::front();
|
return base::front();
|
||||||
}
|
}
|
||||||
@ -122,7 +130,7 @@ namespace boost
|
|||||||
return base::back();
|
return base::back();
|
||||||
}
|
}
|
||||||
|
|
||||||
const value_type& back() const
|
const_reference back() const
|
||||||
{
|
{
|
||||||
return base::back();
|
return base::back();
|
||||||
}
|
}
|
||||||
@ -132,7 +140,7 @@ namespace boost
|
|||||||
return base::operator[](sz);
|
return base::operator[](sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
const value_type& operator[]( difference_type sz ) const
|
const_reference operator[]( difference_type sz ) const
|
||||||
{
|
{
|
||||||
return base::operator[](sz);
|
return base::operator[](sz);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user