Hello,
Taking a look at cppcheck report, I noticed this kind of reports:
vcl/source/treelist/transfer.cxx
132 useStlAlgorithm 398 style Consider using std::fill algorithm instead of
a raw loop
To use std::fill, we'd need to convert the C array into std::array.
Reading https://coders-corner.net/2018/06/16/stdarray-vs-c-style-array/, it
seems there's no real cons about this.
The idea is not only to diminish cppcheck reports but above all try to gain
some perfs (even little but multiplied by the number of calls...) by using
STL. Since we're at the beginning of 6.5, thought it could be relevant.
The code change should be quite straight forward, so risk of regression
should be low.
Is there some kind of rule of thumb to decide between C array and std::array
?
Any thoughts?
Julien
PS : I focused on std::fill but there are other STL related reports by
cppcheck, "std::find_if", "std::count_if", "std::generate", etc.
--
Sent from: http://document-foundation-mail-archive.969070.n3.nabble.com/Dev-f1639786.html
Context
- About replacing some "C-Array" into std::array · julien2412
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.