Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
-
19aa5da9b (dev)
Description
The following code can produce a warning:
QList<Bar> entries; std::vector<Foo> values; values.reserve(entries.size()); // warning
You can silence the warning with:
QList<Bar> entries; std::vector<Foo> values; values.reserve(static_cast<std::size_t>(entries.size())); // no warning but very verbose
Adding usize() to Qt Container would improve the readability of the code:
QList<Bar> entries; std::vector<Foo> values; values.reserve(entries.usize()); // warning
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-112183 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
483849,1 | tst_containerapisymmetry: check that std::size() works | 6.5 | qt/qtbase | Status: NEW | 0 | 0 |
468756,3 | tst_containerapisymmetry: check that std::size() works | dev | qt/qtbase | Status: MERGED | +2 | 0 |
483848,1 | tst_containerapisymmetry: check that std::size() works | 6.6 | qt/qtbase | Status: ABANDONED | 0 | 0 |
483858,1 | tst_containerapisymmetry: check that std::size() works | 6.5 | qt/qtbase | Status: ABANDONED | 0 | 0 |
483859,1 | tst_containerapisymmetry: check that std::size() works | 6.6 | qt/qtbase | Status: ABANDONED | 0 | 0 |
483867,1 | tst_containerapisymmetry: check that std::size() works | 6.5 | qt/qtbase | Status: ABANDONED | 0 | 0 |
483869,1 | tst_containerapisymmetry: check that std::size() works | 6.6 | qt/qtbase | Status: ABANDONED | 0 | 0 |
483877,1 | tst_containerapisymmetry: check that std::size() works | 6.5 | qt/qtbase | Status: ABANDONED | 0 | 0 |
483879,1 | tst_containerapisymmetry: check that std::size() works | 6.6 | qt/qtbase | Status: ABANDONED | 0 | 0 |