From ce271f82f16ee89a18e7bfc9ed8eab7cbd6f37bc Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Mon, 22 Sep 2025 23:38:21 +0200 Subject: Change io::Reader and company to return ReadError::Eof instead of 0. It's debatable if Eof should be considered an error or not. But it is pretty clear it generally is a special response that needs special handling, so easier to keep with the unexpected lot. Also keeps better at higher abstraction levels, such as the line reader. --- src/uline.hh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/uline.hh') diff --git a/src/uline.hh b/src/uline.hh index 28e2936..e6ad9c1 100644 --- a/src/uline.hh +++ b/src/uline.hh @@ -1,8 +1,7 @@ #ifndef ULINE_HH #define ULINE_HH -#include "line.hh" // IWYU pragma: export -#include "uio.hh" // IWYU pragma: export +#include "uio.hh" // IWYU pragma: export #include #include @@ -17,7 +16,7 @@ class Reader { // Returned view is only valid until next call to read. [[nodiscard]] - virtual std::expected read() = 0; + virtual std::expected read() = 0; // Starts at zero. Returns next line. // So, before first read it is zero, after first read it is one. @@ -43,7 +42,7 @@ class Reader { // Returned view is only valid until next call to read. [[nodiscard]] - virtual std::expected read() = 0; + virtual std::expected read() = 0; // Starts at zero. Returns next line. // So, before first read it is zero, after first read it is one. -- cgit v1.3