fix size_t compiler error

This commit is contained in:
blueloveTH 2024-01-20 22:44:32 +08:00
parent 50ab1f81d4
commit d97b24f5cb
2 changed files with 3 additions and 8 deletions

View File

@ -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&);

View File

@ -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);
}