diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2025-09-18 23:57:56 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2025-09-18 23:57:56 +0200 |
| commit | 50348284f5d82ccfd65b0c803ba0ba895912ceff (patch) | |
| tree | 61a7b6a32efdbc36c89d23c688d95b9f6b9a621b /src/umod8.hh | |
| parent | 8e58293ef954d307875019c9a20eaee7dc7a3ed2 (diff) | |
java::uescape: Unicode reader that knows about Java's \uXXXX escapes
Diffstat (limited to 'src/umod8.hh')
| -rw-r--r-- | src/umod8.hh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/umod8.hh b/src/umod8.hh index 4731942..4423f52 100644 --- a/src/umod8.hh +++ b/src/umod8.hh @@ -13,7 +13,7 @@ namespace umod8 { template <std::forward_iterator T> requires std::is_same_v<std::iter_value_t<T>, uint8_t> -std::expected<uint32_t, u::ReadError> read(T& start, const T& end) { +std::expected<uint32_t, u::ReadError> read(T& start, T const& end) { if (start == end) return std::unexpected(u::ReadError::End); uint32_t u; @@ -115,7 +115,7 @@ std::expected<uint32_t, u::ReadError> read(T& start, const T& end) { template <std::forward_iterator T> requires std::is_same_v<std::iter_value_t<T>, uint8_t> std::expected<uint32_t, u::ReadErrorReplace> read_replace(T& start, - const T& end, + T const& end, bool eof) { auto const tmp = start; auto ret = read(start, end); @@ -137,7 +137,7 @@ std::expected<uint32_t, u::ReadErrorReplace> read_replace(T& start, template <std::forward_iterator T> requires std::is_same_v<std::iter_value_t<T>, uint8_t> -bool write(T& start, const T& end, uint32_t code) { +bool write(T& start, T const& end, uint32_t code) { if (code > 0 && code < 0x80) { if (start == end) return false; |
