瀏覽代碼

AK: Add NumericLimits specialization for char.

This is yet another bug because of the 'char'/'signed char'/'unsigned char' shit.
asynts 4 年之前
父節點
當前提交
f221a95a71
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      AK/NumericLimits.h

+ 7 - 0
AK/NumericLimits.h

@@ -48,6 +48,13 @@ struct NumericLimits<signed char> {
     static constexpr bool is_signed() { return true; }
 };
 
+template<>
+struct NumericLimits<char> {
+    static constexpr char min() { return -__SCHAR_MAX__ - 1; }
+    static constexpr char max() { return __SCHAR_MAX__; }
+    static constexpr bool is_signed() { return true; }
+};
+
 template<>
 struct NumericLimits<short> {
     static constexpr short min() { return -__SHRT_MAX__ - 1; }