Skip to content

Commit

Permalink
test: fix compilation on GCC 7
Browse files Browse the repository at this point in the history
GCC 7 complains that:

error: ‘class std::basic_ostream<char>’ has no member named ‘str’; did you mean ‘setf’?
  • Loading branch information
magiblot committed Jan 24, 2024
1 parent 7537d7e commit 2f5aa47
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ TextState TextState::decode(std::string_view input)
{
size_t caret = input.find(chCaret);
if (caret == std::string_view::npos)
throw std::runtime_error((std::ostringstream()
<< "Input text does not have a caret: '" << input << "'"
).str());
{
std::ostringstream os;
os << "Input text does not have a caret: '" << input << "'";
throw std::runtime_error(os.str());
}
size_t anchor = input.find(chAnchor);
if (anchor == std::string_view::npos)
anchor = caret;
Expand Down

0 comments on commit 2f5aa47

Please sign in to comment.