Browse Source

refactor & fix: 修复aFuntool::cout输出char的问题

SongZihuan 3 years ago
parent
commit
12523e6bf0
2 changed files with 6 additions and 0 deletions
  1. 1 0
      include/tool/tool-stdio.h
  2. 5 0
      include/tool/tool-stdio.inline.h

+ 1 - 0
include/tool/tool-stdio.h

@@ -72,6 +72,7 @@ namespace aFuntool {
         PrintFunction *func;
     public:
         inline explicit OutStream(PrintFunction *func_);
+        inline OutStream &operator<<(char a);
         inline OutStream &operator<<(signed char a);
         inline OutStream &operator<<(short a);
         inline OutStream &operator<<(int a);

+ 5 - 0
include/tool/tool-stdio.inline.h

@@ -101,6 +101,11 @@ namespace aFuntool {
 
     }
 
+    inline OutStream &OutStream::operator<<(char a) {
+        func(0, "%c", a);
+        return *this;
+    }
+
     inline OutStream &OutStream::operator<<(signed char a) {
         func(0, "%c", a);
         return *this;