I see inconsistent behavior when calling std::isblank between Visual C ++ on Windows and gcc on Ubuntu, and I wonder which one is correct.
In both compilers - when the locale is by default the C locale, the next call returns false
std::isblank('\n');
This is what I expect. And he squares what I see at cppreference.com
In the default locale C, only a space (0x20) and a horizontal tab (0x09) are classified as empty characters.
However, with C ++, we also have a version that takes the argument std::locale
std::isblank('\n', std::locale::classic());
Here I will put std::locale::classic . Shouldn't that be equivalent to the previous call? Because when I invoke this second version on Windows, it returns true. He considers the new line empty. Linux still says false.
As far as I understand (near std::locale::classic )? And if so, is the version of Visual C ++ incorrect?
c ++ gcc visual-studio locale
Joe
source share