C++ Logo

std-proposals

Advanced search

Re: [std-proposals] constexpr tolower, toupper, isalpha

From: Oliver Hunt <oliver_at_[hidden]>
Date: Tue, 08 Jul 2025 22:19:19 -0700
> On Jul 8, 2025, at 5:25 PM, JJ Marr via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> > Yeah, but... Why do you want it?
>
> I want the ability to do case-insensitive comparisons for the majority of human languages and letters without having to think too much about it, get approval to bring in an external library, or deal with implementation-defined behaviour.

We get that you care about character-point based capitalization as that’s the only form of normalization that you believe matters for the majority of human languages, despite largely being restricted to a specific subset of european and mediterranean language families (and even then capitalization is not the only thing you might be expected to normalize: consider things like `ss` vs `ß` which is an equivalence people expect when searching text). I also know that there are normalizations expected for search in other scripts but I only worked extensively on the text entry part of that and my experience of what people expect for text normalization was limited search field behaviour for European languages.

So far you’ve assumed capitalization is trivial, you’ve assumed it’s a universal form of normalization, and that it’s the only normalization that matters and you’ve rejected basically every response that disagrees with that.

Handling unicode is not something that is reasonably offloaded onto the compiler - which is what constexpr-ification requires. Languages that support unicode do that work at runtime due to precisely this complexity.

—Oliver

Received on 2025-07-09 05:19:31