diff options
| author | Marc Mutz <marc.mutz@kdab.com> | 2015-06-14 11:36:46 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@kdab.com> | 2015-10-07 19:00:21 +0000 |
| commit | abf51f0b274f100736f227d550b65ba6c5ae9266 (patch) | |
| tree | 13eed5867c10448df6fedd90bd7641050ae3afe9 /tests/auto/sql/kernel/qsqldatabase/tst_databases.h | |
| parent | d02645438bcabce074bb83d356d7018570186e19 (diff) | |
QMetaObjectBuilder: replace a QVector with std::vector
...with minimal other changes: signed/unsigned warning fixes, and
API adjustments.
I chose std::vector instead of QVector because it does not require the
contained type to have a default constructor (QVector does). All three
QMeta*Private types in question didn't have a default ctor before they
were ported to be held in QVectors (instead of QLists).
std::vector generally also produces less executable code, and its
push_back() is overloaded for rvalue references, and the code happens to
pass only QMeta*Private temporaries to it, which are conveniently
implicitly move-enabled.
Even though std::vector doesn't care, keep the QMeta*Private classes
marked as Q_MOVABLE_TYPE, so the next person doesn't wonder whether
it was forgotten or intentional.
There are a lot of for loops which use int-based indexing. They all
needed to be adjusted to use size_t-based indexing. Eventually, we
will change that to C++11 range-for loops.
In most places, index validation could now be done in a single unsigned
comparison, but keep that for a separate commit to keep the change
minimal.
Added lots of casts to int from size_t to avoid MSVC's narrowing
conversion warnings.
Saves more than 4.5K of text size on GCC 4.9 optimized C++11 AMD64
Linux builds.
Change-Id: I889eba20fcfb4cb14b1f55f5bc1aad0a767d7bd5
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'tests/auto/sql/kernel/qsqldatabase/tst_databases.h')
0 files changed, 0 insertions, 0 deletions
