Doesn't change functionality, but allows to use range loops in different scope (than declaration), methods to check size or fill.
Details
Details
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Comment Actions
For reference:
https://en.cppreference.com/w/cpp/container/array
It seems like a reasonable change to me.
src/kitemviews/kfileitemmodel.cpp | ||
---|---|---|
2299 | Too bad we have to specify the length, it would be easy for the compiler to deduce. |
Comment Actions
C++ 17 (only :( ) allows to change:
struct someClass{...}; std::array<someClass, 3> array{{}, {}, {}};
to :
struct someClass{...}; std::array array{someClass{}, someClass{}, someClass{}};
I think second version (without size) is harder to read. :(
src/settings/services/servicessettingspage.cpp | ||
---|---|---|
44 ↗ | (On Diff #56745) | This is an unrelated change, please use another commit for these. |
Comment Actions
I'm not sure what has happened - I attached patch with 2 commits, but only one is visible.
Comment Actions
Please push the commit with the std::array port, then open another revision for the other commit.
src/kitemviews/private/kbaloorolesprovider.cpp | ||
---|---|---|
130 | won't the sizeof() here be invalid now? |
src/kitemviews/private/kbaloorolesprovider.cpp | ||
---|---|---|
130 | Good catch, yes that needs to be changed |