mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-12-16 03:08:52 +08:00
stop using distance(next(iter), last)
under some condition, it causes serious error.
This commit is contained in:
@@ -194,9 +194,10 @@ format_underline(const std::string& message, const location<Container>& loc,
|
|||||||
retval += " | ";
|
retval += " | ";
|
||||||
retval += make_string(std::distance(line_begin, loc.iter()),' ');
|
retval += make_string(std::distance(line_begin, loc.iter()),' ');
|
||||||
retval += '^';
|
retval += '^';
|
||||||
retval += make_string(std::distance(std::next(loc.iter()), line_end), '-');
|
retval += make_string(std::distance(loc.iter(), line_end), '-');
|
||||||
retval += ' ';
|
retval += ' ';
|
||||||
retval += comment_for_underline;
|
retval += comment_for_underline;
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user