D23645: Do not generate string list at runtime

Dominik Haumann noreply at phabricator.kde.org
Mon Sep 2 06:43:11 BST 2019

dhaumann added a subscriber: mwolff.
dhaumann added inline comments.


> kossebau wrote in katemodemanager.cpp:214
> I saw you mentioned this elsewhere, but thought it was a typo. Never seen this before, so curious to leatn what advantage using an initializer list brings here. By the name, i would expect its prpose is usually one-time, to init a bigger structure. But by the code it seems here the list is kept, and simply always iterated over?
> Where is the motivation for this?

Because you can write auto and don't have to care. The initializee_list has bwgin(), end(), size(), all which the plain C array does not have:

But I could imagine the generated code even looks the same? Maybe @mwolff knows.

  R39 KTextEditor


To: kossebau, #kate, cullmann
Cc: mwolff, dhaumann, cullmann, kwrite-devel, kde-frameworks-devel, LeGast00n, GB_2, domson, michaelh, ngraham, bruns, demsking, sars
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190902/2a6d20ba/attachment.html>

More information about the KWrite-Devel mailing list