Kaynağa Gözat

fix `size_t` compiler error

blueloveTH 2 yıl önce
ebeveyn
işleme
d97b24f5cb
2 değiştirilmiş dosya ile 3 ekleme ve 8 silme
  1. 1 2
      include/pocketpy/str.h
  2. 2 6
      src/str.cpp

+ 1 - 2
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&);

+ 2 - 6
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<i64>(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);
     }