[Interest] Why QString and not std::string?

Till Oliver Knoll till.oliver.knoll at gmail.com
Fri Jun 15 17:02:12 CEST 2012


[proper recipient]

2012/6/15 Rui Maciel <rui.maciel at gmail.com>:
> ...
>
> Wouldn't it be better to simply provide an alternative std::string
> implementation for that specific case?

That's what has been done: it's called QString ;)

> And how relevant is that
> requirement today?

As others have mentioned, C++ 11 is not available everywhere yet.

>>> Nevertheless, why is it important to support UTF-16?
>>
>> 1. Faster string search modification than for UTF8
>> 2. It's native UTF string format on Windows and Mac OS X.
>
> How relevant is the efficiency of string search modification operations?

EXTREMELY relevant! While not every application is constantly digging
through piles of text, I would dare to say that string operations
(concatenation, search, replace, regexp, ...) are one of the most
common operations that applications do. And be it just the parsing of
config files.

>  And what string data type is used in C++ projects that target Windows
> or OSX?

Guess what: UTF-16 ;) (that's the internal data format of QString).

Cheers, Oliver



More information about the Interest mailing list