Il 08/07/19 21:15, Иван Комиссаров ha scritto:
No, what I’ve actually meant - is it possible to have a free function that takes some string view (QLatin1StringView?) and operates on that view instead of allocating a new string. I’m asking because I’m kinda nooby in UTF and I don’t really know what should happen for non-ascii characters in that case (should such a function just ignore them?). Such a function can solve the problem with .toUpper()/toLower() in QByteArray - just remove them and use free function if you’re sure your string is latin1/you don’t care about UTF (which is the currently supported case).
Operating in-place on a view cannot be done: a view, by definition, is read only. Having free functions instead of member functions, in order to operate on any string-like data, can be done, but they would be a very low level API for most users. (That doesn't mean this kind of APIs shouldn't be offered.)
-- Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer KDAB (France) S.A.S., a KDAB Group company Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com KDAB - The Qt, C++ and OpenGL Experts
smime.p7s
Description: Firma crittografica S/MIME
_______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development