From d97b24f5cbe9131cd9ce2894bf1a530201f58507 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sat, 20 Jan 2024 22:44:32 +0800 Subject: [PATCH] fix `size_t` compiler error --- include/pocketpy/str.h | 3 +-- src/str.cpp | 8 ++------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/pocketpy/str.h b/include/pocketpy/str.h index ad80f5a6..f227296a 100644 --- a/include/pocketpy/str.h +++ b/include/pocketpy/str.h @@ -140,8 +140,7 @@ struct SStream{ SStream& operator<<(const Str&); SStream& operator<<(const char*); SStream& operator<<(int); - SStream& operator<<(unsigned int); - SStream& operator<<(uint64_t); + SStream& operator<<(size_t); SStream& operator<<(i64); SStream& operator<<(f64); SStream& operator<<(const std::string&); diff --git a/src/str.cpp b/src/str.cpp index ccb0a43d..f5eaff01 100644 --- a/src/str.cpp +++ b/src/str.cpp @@ -469,12 +469,8 @@ int utf8len(unsigned char c, bool suppress){ return *this << sn.sv(); } - SStream& SStream::operator<<(unsigned int val){ - return (*this) << static_cast(val); - } - - SStream& SStream::operator<<(uint64_t val){ - // uint64_t could be out of range of `i64`, use `std::to_string` instead + SStream& SStream::operator<<(size_t val){ + // size_t could be out of range of `i64`, use `std::to_string` instead return (*this) << std::to_string(val); }