Make Akonadi compile without QT_STRICT_ITERATORS
ClosedPublic

Authored by dvratil on Apr 6 2019, 2:08 PM.

Details

Summary

Without QT_STRICT_ITERATORS QVector and QList iterators do not satisfy the
STL iterator requirements since they are simply just T*. We can work around
that by introducing a helper to provide the necessary traits for those.

At the same time, turns out QT_STRICT_ITERATORS does not introduce any
overhead (they are inlined so everything gets optimized), confirmed by
comparing the produced assembly in Compiler Explorer.

Test Plan

Compiles

Diff Detail

Repository
R165 Akonadi
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dvratil created this revision.Apr 6 2019, 2:08 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptApr 6 2019, 2:08 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
dvratil requested review of this revision.Apr 6 2019, 2:08 PM
dfaure accepted this revision.Apr 7 2019, 1:19 PM

We'll enable QT_STRICT_ITERATORS in release mode as well for 5.58, but in any case this looks more correct so let's have it.

This revision is now accepted and ready to land.Apr 7 2019, 1:19 PM
This revision was automatically updated to reflect the committed changes.