C++ Logo

std-proposals

Advanced search

Re: [std-proposals] More idiomatic std::islower/std::iswlower

From: Victor Zverovich <victor.zverovich_at_[hidden]>
Date: Sat, 23 Dec 2023 09:22:26 -0800
Also note that islower doesn't make a lot of sense on the code unit level.

- Victor

On Sat, Dec 23, 2023 at 8:05 AM Arthur O'Dwyer via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> On Sat, Dec 23, 2023 at 10:30 AM Wim Leflere via Std-Proposals <
> std-proposals_at_[hidden]> wrote:
>
>> Would there be interest in having more idiomatic versions of the
>> character check functions (from cctype
>> <https://en.cppreference.com/w/cpp/header/cctype> & cwctype
>> <https://en.cppreference.com/w/cpp/header/cwctype>)?
>>
>
> It sounds like you're basically proposing that there should be
> one-argument, as well as two-argument, overloads of
> https://en.cppreference.com/w/cpp/locale/islower
> where the one-argument overload `std::islower(t)` would mean no more or
> less than `std::islower(t, std::locale())`.
>
> "bool std::is_lower(char ch)" and "bool std::is_lower(wchar_t ch)"
>>
>
> FYI, you can't land-grab the name `is_lower`; many real-world codebases
> define `is_lower` for themselves (even as a macro) precisely because that
> name is well-known *not* to be reserved to the implementation. You could,
> physically, land-grab `isclower` or `islowerchar` or something. But really,
> I don't see why you'd want to avoid the existing name `islower`.
>
> I don't think such a proposal is really worth it. Locales are awful;
> nobody likes them. You might have more luck standardizing an
> "is-lower-case-ASCII" function — which I suspect has even been proposed
> before, so you should also search for that prior proposal and see how and
> by whom it was shot down. (I would naturally suspect IBM, with the EBCDIC,
> in the LEWG.)
>
> HTH,
> Arthur
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2023-12-23 17:22:38