mirror of
https://github.com/boostorg/range.git
synced 2026-01-25 00:12:22 +01:00
[range] Merge Boost.Range bug fixes to release branch (fixes #6944; fixes #7407; fixes #7408; fixes #7731; fixes #7827; fixes #8338; fixes #8453).
[SVN r84823]
This commit is contained in:
3
include/boost/range/adaptor/indexed.hpp
Executable file → Normal file
3
include/boost/range/adaptor/indexed.hpp
Executable file → Normal file
@@ -55,6 +55,9 @@ namespace boost
|
||||
index_type m_index;
|
||||
|
||||
public:
|
||||
indexed_iterator()
|
||||
: m_index(index_type()) {}
|
||||
|
||||
explicit indexed_iterator( Iter i, index_type index )
|
||||
: base(i), m_index(index)
|
||||
{
|
||||
|
||||
@@ -330,8 +330,8 @@ namespace boost {
|
||||
struct BidirectionalRangeConcept : ForwardRangeConcept<T>
|
||||
{
|
||||
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
|
||||
BOOST_RANGE_CONCEPT_ASSERT((BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::iterator>));
|
||||
BOOST_RANGE_CONCEPT_ASSERT((BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::const_iterator>));
|
||||
BOOST_RANGE_CONCEPT_ASSERT((range_detail::BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::iterator>));
|
||||
BOOST_RANGE_CONCEPT_ASSERT((range_detail::BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::const_iterator>));
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -348,8 +348,8 @@ namespace boost {
|
||||
struct RandomAccessRangeConcept : BidirectionalRangeConcept<T>
|
||||
{
|
||||
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
|
||||
BOOST_RANGE_CONCEPT_ASSERT((RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::iterator>));
|
||||
BOOST_RANGE_CONCEPT_ASSERT((RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::const_iterator>));
|
||||
BOOST_RANGE_CONCEPT_ASSERT((range_detail::RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::iterator>));
|
||||
BOOST_RANGE_CONCEPT_ASSERT((range_detail::RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::const_iterator>));
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
2
include/boost/range/detail/extract_optional_type.hpp
Executable file → Normal file
2
include/boost/range/detail/extract_optional_type.hpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifdef BOOST_NO_PARTIAL_TEMPLATE_SPECIALIZATION
|
||||
#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
|
||||
|
||||
#define BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( a_typedef ) \
|
||||
template< typename C > \
|
||||
|
||||
@@ -217,7 +217,7 @@ namespace boost
|
||||
const std::ptrdiff_t sz = static_cast<std::ptrdiff_t>(step_size >= 0 ? step_size : -step_size);
|
||||
const Integer l = step_size >= 0 ? last : first;
|
||||
const Integer f = step_size >= 0 ? first : last;
|
||||
const std::ptrdiff_t num_steps = (l + ((l-f) % sz) - f) / sz;
|
||||
const std::ptrdiff_t num_steps = (l - f) / sz + ((l - f) % sz ? 1 : 0);
|
||||
BOOST_ASSERT(num_steps >= 0);
|
||||
|
||||
return strided_integer_range<Integer>(
|
||||
|
||||
6
include/boost/range/istream_range.hpp
Executable file → Normal file
6
include/boost/range/istream_range.hpp
Executable file → Normal file
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
#include <iterator>
|
||||
#include <istream>
|
||||
#include <iosfwd>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
|
||||
@@ -27,8 +27,8 @@ namespace boost
|
||||
istream_range(std::basic_istream<Elem, Traits>& in)
|
||||
{
|
||||
return iterator_range<std::istream_iterator<Type, Elem, Traits> >(
|
||||
std::istream_iterator<Type>(in),
|
||||
std::istream_iterator<Type>());
|
||||
std::istream_iterator<Type, Elem, Traits>(in),
|
||||
std::istream_iterator<Type, Elem, Traits>());
|
||||
}
|
||||
} // namespace range
|
||||
using range::istream_range;
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/iterator/iterator_traits.hpp>
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/type_traits/is_abstract.hpp>
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
#include <boost/type_traits/is_pointer.hpp>
|
||||
#include <boost/range/functions.hpp>
|
||||
#include <boost/range/iterator.hpp>
|
||||
@@ -167,7 +169,8 @@ namespace boost
|
||||
|
||||
private: // for return value of operator()()
|
||||
typedef BOOST_DEDUCED_TYPENAME
|
||||
boost::mpl::if_< boost::is_abstract<value_type>,
|
||||
boost::mpl::if_< boost::mpl::or_< boost::is_abstract< value_type >,
|
||||
boost::is_array< value_type > >,
|
||||
reference, value_type >::type abstract_value_type;
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user