From 1de0003e292034f11d05be7ffbe366f4fc23bb76 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 10 May 2025 21:19:35 +0200 Subject: Fix compiler warning on space in string-literal suffix def GCC complains: src/string.hh:376:39: warning: space between quotes and suffix is deprecated in C++23 [-Wdeprecated-literal-operator] 376 | inline constexpr StringView operator"" _sv(const char* str, size_t) | ^~ --- src/string.hh | 4 ++-- src/units.hh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/string.hh b/src/string.hh index fd1e5b74..3b8c9013 100644 --- a/src/string.hh +++ b/src/string.hh @@ -368,12 +368,12 @@ inline auto operator<=>(const StringView& lhs, const StringView& rhs) } -inline String operator"" _str(const char* str, size_t) +inline String operator""_str(const char* str, size_t) { return String(str); } -inline StringView operator"" _sv(const char* str, size_t) +inline StringView operator""_sv(const char* str, size_t) { return StringView{str}; } diff --git a/src/units.hh b/src/units.hh index 9d2511b9..eb802351 100644 --- a/src/units.hh +++ b/src/units.hh @@ -109,7 +109,7 @@ struct LineCount : public StronglyTypedNumber }; [[gnu::always_inline]] -inline constexpr LineCount operator"" _line(unsigned long long int value) +inline constexpr LineCount operator""_line(unsigned long long int value) { return LineCount(value); } @@ -120,7 +120,7 @@ struct ByteCount : public StronglyTypedNumber }; [[gnu::always_inline]] -inline constexpr ByteCount operator"" _byte(unsigned long long int value) +inline constexpr ByteCount operator""_byte(unsigned long long int value) { return ByteCount(value); } @@ -135,7 +135,7 @@ struct CharCount : public StronglyTypedNumber }; [[gnu::always_inline]] -inline constexpr CharCount operator"" _char(unsigned long long int value) +inline constexpr CharCount operator""_char(unsigned long long int value) { return CharCount(value); } @@ -146,7 +146,7 @@ struct ColumnCount : public StronglyTypedNumber }; [[gnu::always_inline]] -inline constexpr ColumnCount operator"" _col(unsigned long long int value) +inline constexpr ColumnCount operator""_col(unsigned long long int value) { return ColumnCount(value); } -- cgit v1.2.3