string TextQuery::text_line(line_no line) const
{
if (line < lines_of_text.size())
return lines_of_text[line];
throw std::out_of_range("line number out of range");
}
该函数带有一个行号参数,返回该行号所对应的输入文本行。由于上述代码
使用了 TextQuery 类,因此不能直接输出(因为 lines_of_text 是私有的),