[Development] RFC: Proposal for a semi-radical change in Qt APIs taking strings

Marc Mutz marc.mutz at kdab.com
Fri Oct 16 19:03:18 CEST 2015


On Friday 16 October 2015 17:03:41 Koehne Kai wrote:
> I guess it's not by incidence that there's also a std::string_view coming,
> see e.g.
> 
> https://www.youtube.com/watch?v=H9gAaNRoon4
> 
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3762.html
> 
> So, is this really the same, except non-templated and for QString (with
> conversion from/to Qt types)? Or do you have other differences in mind?

Nothing qualitatively different. Just std::basic_string_view<char16_t> with a 
subset of QString API, yes.

The problem is that I feel we can't wait for string_view because we already 
drown in QString equivalents. Plus, we'd get the usual replies if anyone 
suggested to use std::string_view as such a fundamental Qt type. Naturally, 
QStringView would trivially convert to and from std::u16string_view with no 
runtime overhead (unless compiler writers ruin the concept of string_view by 
implementing it as (T*, size_t) in one compiler and (T*, T*) in another....)

Thanks,
Marc

-- 
Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - The Qt Experts



More information about the Development mailing list