[Development] char8_t summary?
Mutz, Marc
marc at kdab.com
Sat Jul 13 08:44:20 CEST 2019
On 2019-07-12 22:37, Matthew Woehlke wrote:
[...]
> So, perhaps you should suggest a more specific example?
I did: replace and relational operators. And you're right to look at
startsWith(), because that is indeed binary (*this being the first
argument). And it's also one which is thoroughly view-enabled. But this
just means that my replace() math was wrong: it's not binary, it's
ternary (*this, before, after) and that means not 16 vs. 25 overloads,
but 64 vs. 125 overloads. And that _is_ with views enabled (as per,
QtPrivate::startsWith() (QChar arguments are handled one level up, and
converted to a QStringView argument).
And speaking about startsWith(): if you drill down through the
templates, you will end up in qt_compre_strings, which is not templated,
and even if it could be today, which would be rather pointless, you just
drill one more level down and end up in ucstrncmp etc, which are oh so
far away from ever being templates...
So, as you can see, we're already using templates where it makes sense,
but at some point you do need to go into the gritty details, and then
it's assembler, not templates.
Thanks,
Marc
More information about the Development
mailing list