forward the writer out of get_line

master
Daniel Kolesa 2017-06-19 17:00:53 +02:00
parent 2ce488002a
commit 146da105b9
1 changed files with 2 additions and 1 deletions

View File

@ -301,7 +301,7 @@ struct stream {
* @see get()
*/
template<typename T = char, typename R>
void get_line(R &&writer, bool keep_nl = false) {
R &&get_line(R &&writer, bool keep_nl = false) {
bool cr = false;
/* read one char, if it fails to read at all just propagate errors */
T c = get<T>();
@ -327,6 +327,7 @@ struct stream {
if (gotc && keep_nl) {
writer.put('\n');
}
return std::forward<R>(writer);
}
/** @brief Writes all given values into the stream.