File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -222,8 +222,20 @@ inline std::string first_line(const std::string &str)
222222 return to_delim (str, ' \n ' );
223223}
224224
225- // Define a common interpretation of what constitutes a space character.
226- // Return true if c is a space char.
225+ /* *
226+ * Define a common interpretation of what constitutes a space character.
227+ *
228+ * According to the Notes section at
229+ * https://en.cppreference.com/w/cpp/string/byte/isspace.html:
230+ *
231+ * "Like all other functions from <cctype>, the behavior of `std::isspace`
232+ * is undefined if the argument's value is neither representable as
233+ * `unsigned char` nor equal to `EOF`. To use these functions safely with
234+ * plain chars (or signed chars), the argument should first be converted
235+ * to `unsigned char`"
236+ *
237+ * @return true if c is a space char.
238+ **/
227239inline bool is_space (const char c)
228240{
229241 return std::isspace (static_cast <unsigned char >(c)) != 0 ;
You can’t perform that action at this time.
0 commit comments