summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qcommandlineparser.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-12-22 16:01:23 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2022-01-13 21:19:24 +0100
commitb1cf7285f9a469b8f0c62f2048e4c0828def5f1a (patch)
tree768548d84a013ad7c07474136bf6a2a7c765a224 /src/corelib/tools/qcommandlineparser.cpp
parent552c4a9655ea22c354454132a9bda7a1c7c836f7 (diff)
Properly detect and declare contiguous iterators
The recommended way to detect a contiguous iterator isn't to check the iterator_category; it's to use the iterator concepts. Similarly, the recommendation set in place by P2259 (for being backwards-compatible) is to declare a iterator_concept member, not to change iterator_category to a C++20 category, (also) because legacy code may be checking for equality against a specific category, rather than for convertibility. This is erroneous, but such code exists, alas. This is enshrined in C++20's stdlib: for instance, iterator_traits<Foo*> has random_access_category_tag as iterator_category, but contiguous_iterator_tag as its iterator_concept. Hence: 1) in QArrayDataOps use the concept, and not the category, to do the check 2) when declaring iterators, keep the category as random access, and introduce the concept alias (if supported). Pick-to: 6.2 6.3 Change-Id: Ib600da7331d687a15082becaa6be06aefc24bb9c Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/tools/qcommandlineparser.cpp')
0 files changed, 0 insertions, 0 deletions