mirror of
https://github.com/boostorg/algorithm.git
synced 2025-07-12 03:56:35 +02:00
fixed the empty string handling for the split iterator
[SVN r66220]
This commit is contained in:
@ -258,9 +258,13 @@ namespace boost {
|
|||||||
m_Next(Begin),
|
m_Next(Begin),
|
||||||
m_End(End),
|
m_End(End),
|
||||||
m_bEof(false)
|
m_bEof(false)
|
||||||
|
{
|
||||||
|
// force the correct behavior for empty sequences and yield at least one token
|
||||||
|
if(Begin!=End)
|
||||||
{
|
{
|
||||||
increment();
|
increment();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//! Constructor
|
//! Constructor
|
||||||
/*!
|
/*!
|
||||||
Construct new split_iterator for a given finder
|
Construct new split_iterator for a given finder
|
||||||
@ -278,8 +282,12 @@ namespace boost {
|
|||||||
m_Next=::boost::begin(lit_col);
|
m_Next=::boost::begin(lit_col);
|
||||||
m_End=::boost::end(lit_col);
|
m_End=::boost::end(lit_col);
|
||||||
|
|
||||||
|
// force the correct behavior for empty sequences and yield at least one token
|
||||||
|
if(m_Next!=m_End)
|
||||||
|
{
|
||||||
increment();
|
increment();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user