diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-08-19 23:30:38 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-02-17 15:05:15 +0000 |
commit | 18885297de880493831f63d20a8d45c6689a01b8 (patch) | |
tree | c4a204b499d37cc051b0f11916f50d38123b6797 /src/corelib/tools/qpair.h | |
parent | 40d6e8adf5e3cc45b3bd4a94ad3b57f9444e447f (diff) |
QList: share the implementations of contains()/count() with QVector where possible
If QList data-layout-compatible with QVector and a C array, implement count()
via std::count() and contains() via std::find() and use const_pointer
instead of const_iterator as the iterators. This essentially makes
the QVector and QList implementations identical to each other, at least for
important cases such as QString.
To switch between the different implementations, use tag dispatching instead
of the previously used technique "use 'if' as if it were 'static if'", which
imposes accidental requirements on the element types (something that esp.
QVector is plagued with).
Change-Id: I6caf74442a22059676b5bf115a6089768f3a0952
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qpair.h')
0 files changed, 0 insertions, 0 deletions