use std::advance to work with std::iterators
This commit is contained in:
parent
b6cd3b37ef
commit
da960fea33
1 changed files with 4 additions and 1 deletions
|
@ -38,7 +38,10 @@ struct error_handler
|
|||
Iterator err_pos, boost::spirit::info const& what) const
|
||||
{
|
||||
std::stringstream s;
|
||||
s << what << " expected but got: " << std::string(err_pos, std::min(err_pos + 16,last));
|
||||
auto start = err_pos;
|
||||
std::advance(err_pos,16);
|
||||
auto end = err_pos;
|
||||
s << what << " expected but got: " << std::string(start, end);
|
||||
throw std::runtime_error(s.str());
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue