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/u16.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/u16.hh') diff --git a/src/u16.hh b/src/u16.hh index 70ba157..17a30f4 100644 --- a/src/u16.hh +++ b/src/u16.hh @@ -13,7 +13,7 @@ namespace u16 { template requires std::is_same_v, uint16_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); uint16_t u = *start; @@ -39,7 +39,7 @@ std::expected read(T& start, const T& end) { template requires std::is_same_v, uint16_t> std::expected read_replace(T& start, - const T& end, + T const& end, bool eof) { auto const tmp = start; auto ret = read(start, end); @@ -61,7 +61,7 @@ std::expected read_replace(T& start, template requires std::is_same_v, uint16_t> -bool write(T& start, const T& end, uint32_t code) { +bool write(T& start, T const& end, uint32_t code) { if (code < 0x10000) { if (start == end) return false; @@ -80,7 +80,7 @@ bool write(T& start, const T& end, uint32_t code) { template requires std::is_same_v, uint16_t> -bool skip(T& start, const T& end) { +bool skip(T& start, T const& end) { if (start == end) return false; if (*start >= 0xd800 && *start <= 0xdbff) { -- cgit v1.3