0

Is std::isspace the opposite of std::isgraph in C++ (locale versions)? That is, is the following true?

char c = getCharFromSomewhere();
std::locale loc = getLocaleFromSomewhere();
std::isspace(c, loc) != std::isgraph(c, loc)

They seem to be true when I test, but I can't be certain this is true in all locales.

Jimmy
  • 158
  • 1
  • 10
  • 2
    I would say no. There are control characters, e.g. `'\a'`, which are not spaces and not graphic. See [`std::isgraph`](https://en.cppreference.com/w/cpp/string/byte/isgraph), especially the chart at the bottom. – Thomas Matthews Nov 12 '20 at 00:57
  • 1
    `graph` is defined as `alnum | punct`, but there is also `cntrl` and `print` which are not included in it. – IS4 Nov 12 '20 at 00:58

0 Answers0