use std::advance to work with std::iterators

This commit is contained in:
artemp 2015-01-16 16:40:28 +01:00
parent b6cd3b37ef
commit da960fea33

View file

@ -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());
}
};