[Development] char8_t summary?

Matthew Woehlke mwoehlke.floss at gmail.com
Fri Jul 12 22:37:59 CEST 2019

On 12/07/2019 16.05, Mutz, Marc via Development wrote:
> On 2019-07-12 17:27, Matthew Woehlke wrote:
>> On 11/07/2019 15.01, Thiago Macieira wrote:
> [...]
>>> Except that the whole point of those methods is that they can be more
>>> efficient when the encoding is known and therefore templating won't
>>> help.
>> So those cases can employ specializations. Or, perhaps better, wrap the
>> implementation bits where it matters in `if constexpr`.
> You should, maybe, take a look at qstring.cpp before you make such
> uninformed statements.

I was thinking in terms of what I would do if I was implementing things
from scratch; not how I would refactor existing code.

That said, I took a look at startsWith, and... surprise! It is *already
a template*. So at least in that case, it isn't obvious why adding more
combinations would be so terribly onerous.

For that matter, making it a template (with explicit extern
instantiations) would already be an improvement since it would cut down
the several extant definitions into one definition and some declarations
(which could even be enumerated by macro magic).

So, perhaps you should suggest a more specific example?


More information about the Development mailing list