+ return (0 == (ch & ~0xff) || ~0 == (ch | 0xff)) != 0;
+ }
+
+ // *** Note on assertions: The precondition is that the calls to
+ // these functions do not violate the required range of ch (int)
+ // which is that strict_ischar(ch) should be true. It is the
+ // responsibility of the caller to make sure this precondition is not
+ // violated.
+
+ static bool
+ strict_ischar(int ch)
+ {
+ // ch should be representable as an unsigned char
+ return ch >= 0 && ch <= UCHAR_MAX;