From 50348284f5d82ccfd65b0c803ba0ba895912ceff Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Thu, 18 Sep 2025 23:57:56 +0200 Subject: java::uescape: Unicode reader that knows about Java's \uXXXX escapes --- src/u8.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/u8.hh') diff --git a/src/u8.hh b/src/u8.hh index 5292602..d673caa 100644 --- a/src/u8.hh +++ b/src/u8.hh @@ -13,7 +13,7 @@ namespace u8 { template requires std::is_same_v, uint8_t> -std::expected read(T& start, const T& end) { +std::expected read(T& start, T const& end) { if (start == end) return std::unexpected(u::ReadError::End); uint32_t u; @@ -106,7 +106,7 @@ std::expected read(T& start, const T& end) { template requires std::is_same_v, uint8_t> std::expected read_replace(T& start, - const T& end, + T const& end, bool eof) { auto const tmp = start; auto ret = read(start, end); @@ -128,7 +128,7 @@ std::expected read_replace(T& start, template requires std::is_same_v, uint8_t> -bool write(T& start, const T& end, uint32_t code) { +bool write(T& start, T const& end, uint32_t code) { if (code < 0x80) { if (start == end) return false; @@ -164,7 +164,7 @@ bool write(T& start, const T& end, uint32_t code) { template requires std::is_same_v, uint8_t> -bool skip(T& start, const T& end) { +bool skip(T& start, T const& end) { if (start == end) return false; switch (*start >> 4) { -- cgit v1.3