Boost logo

Boost :

Subject: Re: [boost] [Convert] std::isspace requires unsigned #28
From: Vladimir Batov (Vladimir.Batov_at_[hidden])
Date: 2017-03-21 01:04:18


On 2017-03-21 11:46, Vladimir Batov via Boost wrote:
> On 2017-03-21 11:43, Gavin Lambert via Boost wrote:
>> ...
>> I haven't verified but presumably
>> std::char_traits<char/wchar_t>::to_int_type() would convert correctly
>> for input to std::isspace/iswspace.
>
> Thanks, Gavin, indeed I should have a dig in char_traits before
> re-inventing the wheel. Thanks.

Isn't funny? I went to cppreference.com and immediately bumped into the
exact problem I am trying to address:

struct ci_char_traits : public std::char_traits<char> {
     static bool eq(char c1, char c2) {
          return std::toupper(c1) == std::toupper(c2);
      }

The example seems to ignore that char vs. "unsigned char"
issue/vulnerability.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk