mirror of
https://github.com/boostorg/algorithm.git
synced 2025-07-06 09:16:33 +02:00
fixed problem with a iterator running out of range
(reported by gcc3.4 as an invalid condition even though the iterator has not been dereferenced) [SVN r22462]
This commit is contained in:
@ -325,10 +325,14 @@ namespace boost {
|
|||||||
typedef ForwardIteratorT input_iterator_type;
|
typedef ForwardIteratorT input_iterator_type;
|
||||||
typedef iterator_range<ForwardIteratorT> result_type;
|
typedef iterator_range<ForwardIteratorT> result_type;
|
||||||
|
|
||||||
input_iterator_type It=Begin+m_N;
|
if(std::distance(Begin,End) >= m_N)
|
||||||
if ( It >= End ) It=End;
|
{
|
||||||
|
return result_type(Begin,End);
|
||||||
return result_type( Begin, It );
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return result_type(Begin,Begin+m_N);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user