summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydata.h
Commit message (Collapse)AuthorAgeFilesLines
* Containers: add max_size()Giuseppe D'Angelo2024-02-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One more method for STL compatibility. This one is particularly subtle as it's required by the `reservable-container` concept: https://eel.is/c++draft/ranges#range.utility.conv.general-3 Without this concept, ranges::to won't reserve() before copying the elements (out of a sized range which isn't a common_range). Implementation notes: there were already a couple of constants denoting the maximum QByteArray and QString size. Centralize that implementation in QTypedArrayData, so that QList can use it too. The maximum allocation size (private constant) needs a even more central place so that even QVLA can use it. Lacking anything better, I've put it in qcontainerfwd.h. Since our containers aren't allocator-aware, I can make max_size() a static member, and replace the existing constants throughout the rest of qtbase. (I can't kill them yet as they're used by other submodules.) [ChangeLog][QtCore][QList] Added max_size(). [ChangeLog][QtCore][QString] Added max_size(). [ChangeLog][QtCore][QByteArray] Added max_size(). [ChangeLog][QtCore][QVarLengthArray] Added max_size(). Change-Id: I176142e31b998f4f787c96333894b8f6653eb70d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QArrayData/Pointer: s/QPair/std::pair/Marc Mutz2023-12-131-6/+6
| | | | | | | | | | Also port from qMakePair to just braced initialization and CTAD. Task-number: QTBUG-115841 Pick-to: 6.7 Change-Id: Ifd7220ae88b101351e91d1488ce18715eb4880e5 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qarraydata.h: don't rely on transitive include of qflags.hMarc Mutz2023-12-131-0/+1
| | | | | | | | | The QFlags header came in via qpair.h and broke when we tried to remove qglobal.h from qpair.h. Pick-to: 6.7 6.6 6.5 6.2 Change-Id: I335b84cc1d73303f8f2497427a21fba255ee11f9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QArrayData: move AlignedQArrayData to the public headerThiago Macieira2023-12-111-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | This allows us to use it in QTypedArrayData<T>::AlignmentDummy, which is used in __builtin_assume_aligned() as a hint to the compiler. This increases the value we were passing as the compiler hint from 4 to 8 on 32-bit platforms and from 8 to 16 on 64-bit platforms. We actually do align to a bit higher than even that, but that's not an ABI guarantee we're making. However, it looks like GCC on 32-bit platforms is buggy, so we work around it. Commit r240248 ("Make max_align_t respect _Float128.", 63012d9a57edc950c5f30242d1e19318b5708060 in Git) increased std::max_align_t to 16 bytes on all platforms, saying "Such an increase is of course an ABI change" and "I think glibc malloc alignment should also increase to 16-byte 32-bit x86", but such a change to glibc was never implemented. Moreover, there are systems that don't use glibc, such as when using GCC on other OSes. This is not a change in Qt behavior anywhere. i386 does not (usually) do alignment checks, so most code wouldn't notice this at all. Pick-to: 6.7 Change-Id: I79e700614d034281bf55fffd178fa0aee2344307 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QArrayData: add allocate1 and allocate2 for 1- and 2-byte typesThiago Macieira2023-12-111-5/+27
| | | | | | | | | | | | | | | | This makes the two most-often used QTypedArrayData::allocate() -- the ones for char (for QByteArray) and char16_t (for QString) -- go to specialized versions, which have much simpler code. After all, multiplications by 1 are quite trivial. I didn't check whether an LTO compiler was const-propagating the sizes in inlined calls from qstring.cpp and qbytearray.cpp. But not everyone uses LTO, so this benefits everyone, in a very hot path, for minimal cost. Pick-to: 6.7 Change-Id: Ifa1111900d6945ea8e05fffd177dd1ce659b3fd5 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QArrayData: remove contradicting const qualifier from needsDetach()Thiago Macieira2023-10-111-1/+1
| | | | | | | | | | The documentation above says it's intentionally not const and that's how I had designed it. It was added by accident on with the noexcept qualifier on commit c129362b4d9512bd33004d430bc3b817546cb1b7 ("Add a couple of noexcept"). Change-Id: I8f3ce163ccc5408cac39fffd178c7fd237c6e079 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-39/+3
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QArrayData: store the right flag type, not an intGiuseppe D'Angelo2021-05-171-1/+1
| | | | | | | | There's no reason to be storing `int` in the array data header and then using it as a QFlags. Just store the QFlags. Change-Id: I78f489550d74d15a560dacf338110d80a7ddfdd2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qarraydata.h: use __has_builtin directlyFabian Kosmale2021-03-211-1/+1
| | | | | | | | All our supported compilers support __has_builtin; also, no need to check for old GCC versions; we require at least GCC 8. Change-Id: I86d955188e71d6da5ebd1b2455e0f7fad8072bfb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move the iterator from QTypedArrayData to QListLars Knoll2020-11-171-73/+0
| | | | | | | | | | The low level implementation does not use it at all, so there's no point having the iterator in QTypedArrayData. Having it in QList removes and indirection and will lead to clearer error messages. Change-Id: I4af270c3cdb39620e5e52e835eb8fe1aa659e038 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Only export the non inline methods of QArrayDataLars Knoll2020-11-171-6/+6
| | | | | | Change-Id: I4a66fd13ee3e6b4ceb3f5d58de4a44aa394b9e0e Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename AllocationPosition enum and its membersLars Knoll2020-11-041-3/+3
| | | | | | | Use GrowsAt* and GrowthPosition as that is clearer. Change-Id: I3c173797dec3620f508156efc0c51b4d2cd3e142 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clean up out allocation handlingLars Knoll2020-11-041-18/+11
| | | | | | | | | | Get rid of the allocation options inside the flags field of QArrayData, they are really a completely separate thing. Change-Id: I823750ab9e4ca85642a0bd0e471ee79c9cde43fb Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup QArrayDataOps::reallocate() and relatedLars Knoll2020-11-041-4/+8
| | | | | | | | | | Don't use QArrayData::GrowsForward/Backward anymore and replace it with a simple 'bool grow'. Change-Id: Ifddfef3ae860b11dda4c40854c71ef2aeb29df34 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compiler warning from uninitialized membersVolker Hilsheimer2020-10-211-1/+1
| | | | | | | | | | | | When building tst_qmetatype.cpp, clang generates the warning that class 'AlignmentDummy' does not declare any constructor to initialize its non-modifiable members Turn the class into a struct, which doesn't generate such warnings. Change-Id: I61013a10418238a11824b18ff1e927bbafa46ec2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace Q_REQUIRED_RESULT with [[nodiscard]]Allan Sandfeld Jensen2020-09-251-3/+3
| | | | | | | It was already used many places directly making the code inconsistent. Change-Id: I3b14bc6c333640fb3ba33c71eba97e78c973e44b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add QArrayDataPointer::freeSpace*() functionsAndrei Golubev2020-08-181-1/+10
| | | | | | | | | | | | | Added functions that tell how much free space is available at the beginning and at the end of the storage Updated preconditions of operations to use freeSpace* functions Also, changed casts uint(this->size) to size_t(this->size) Task-number: QTBUG-84320 Change-Id: Iad94c1060a00f62068da9d1327e332a00d4f4109 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix compilation in C++20 modeAllan Sandfeld Jensen2020-08-081-6/+12
| | | | | | | | The comparisons with pointer were ambiguous as the comparisons could be done between iterators or pointers. Change-Id: I0484946931502d04bd63519fcd6e886c732758d3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Allow allocating more than 2G items in a vectorLars Knoll2020-07-061-11/+11
| | | | | | | | | | | Also adjust qCalculateBlockSize() to be able to handle large allocations. QVector::length() is currently still limited to 2G items, that will get changed in a later commit. Change-Id: I3a92fbfd7f281d30844c5fafa3b9a474bc347c19 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Implement a proper iterator for QTypedArrayDataLars Knoll2020-07-061-2/+66
| | | | | | | | | | | This avoids ambiguities in our API when someone e.g. writes vector.insert(0, ...). It requires a slight workaround in qlalr, where std::search() for libc++ doesn't like that our difference_type is qsizetype. Change-Id: I40aa1040781ffbdd12d04410078207969b3bde53 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a couple of noexceptLars Knoll2020-07-061-9/+9
| | | | | Change-Id: I993da2094482092540388ee72be3262bac94fad7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of QArrayData::sharedNull()Lars Knoll2020-07-061-17/+1
| | | | | | | | Remove the last places where those got used and avoid allocations when we resize to 0. Change-Id: Ib553f4e7ce7cc24c31da15a55a86d18bdf1cc5c3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of QArrayData::isMutable()Lars Knoll2020-07-061-11/+2
| | | | | Change-Id: Ifb6368b83cd12ec3897c6b6b846d71bffa1f74b9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of unused flags in QArrayDataLars Knoll2020-07-061-17/+6
| | | | | Change-Id: I3ea754b44fb33e33baba0781d9ae15b7f3b3d8eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Simplify Q_ARRAY_LITERALLars Knoll2020-07-061-43/+0
| | | | | | | And clean up some unused pieces of code. Change-Id: I285b6862dc67b7130af66d3e08f652b1a56b990e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of shared null for QByteArray, QString and QVectorLars Knoll2020-07-061-61/+7
| | | | | | | | | | | | | | As a side effect, data() can now return a nullptr. This has the potential to cause crashes in existig code. To work around this, return an empty string from QString::data() and QByteArray::data() for now. For Qt 6 (and once all our internal issues are fixed), data() will by default return a nullptr for a null QString, but we'll offer a #define to enable backwards compatible behavior. Change-Id: I4f66d97ff1dce3eb99a239f1eab9106fa9b1741a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove method declaration that's not used or implementedLars Knoll2020-07-021-2/+0
| | | | | | Change-Id: If8c03c08b7bfc162908510cac278ce9267b61cdf Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-191-7/+7
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Ensure left/right/mid behave in a compatible wayLars Knoll2020-06-091-1/+31
| | | | | | | | | | | | | | | | | | | | QString and QStringRef did bounds checking for left/right/mid, whereas QStringView was asserting on out of bounds. Relax the behavior for QStringView and do bounds checking on pos/n as well. This removes a source of potentially hidden errors when porting from QStringRef (or QString) to QStringView. Unfortunately, one difference remains, where QByteArray::left/right() behaves differently (and somewhat more sane) than QString and QStringRef. We're keeping the difference here, as it has been around for many years. Mark left/right/mid as obsolete and to be replaced with the new first/last/slice methods. Change-Id: I18c203799ba78c928a4610a6038089f27696c22e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QArrayData: stop using std::is_literal_typeGiuseppe D'Angelo2020-06-091-10/+2
| | | | | | | | The trait is deprecated in C++17 and removed in C++20. Enforce the same meaning by using a constexpr variable instead. Change-Id: Ief13afc3f889af09094391e626037778d879c4f5 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Get rid of some QT_STRICT_ITERATORS leftoverLars Knoll2020-03-051-73/+0
| | | | | | | | Amends 06456873fceddcd340431fc5999c50ff6d3c2371. Fixes: QTBUG-82611 Change-Id: I8b1e01549f3e910b85a571833237e38a7c2b49a9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Final removal of the size and offset members from QArrayDataThiago Macieira2019-12-081-45/+4
| | | | | | | | Those members are not required anymore and now part of the object itself. Change-Id: If9eb5355ca8f2cf9528f6f63ca4e172acc9f9aed Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Start moving QArrayData's size and data pointer to the main classThiago Macieira2019-12-081-36/+45
| | | | | | | | | | | | | This requires that the allocation functions return two pointers: the d pointer and the pointer to the actual data. Ported QArrayDataPointer & SimpleVector to the inlined size & data. For now, the size and offset members are not yet removed from QArrayData, to let QVector, QByteArray and QString compile unmodified. Change-Id: I8489300976723d75b8fd5831427b1e2bba486196 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Stop using the reference counter to store data stateThiago Macieira2019-12-081-10/+17
| | | | | | | | | | | Instead of using the reference count to store whether the data is sharable and whether the header is immutable, move the settings to the flags member. This allows us to save one comparison per deref() or needsDetach(). It also allows for the possibility of mutable data pointed to by a static header. Change-Id: Ie678a2ff2bb9bce73497cb6138b431c465b0f3bb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add reference-count manipulation functions to QArrayData and hide refThiago Macieira2019-12-081-3/+23
| | | | | | | | The next change will stop using some values in the reference counter as settings from the data. Change-Id: I94df1fe643896373fac2f000fff55bc7708fc807 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Introduce the Mutable flag and move QArrayDataPointer::needsDetachThiago Macieira2019-12-081-1/+11
| | | | | | | | | | | | | | | | | | The Mutable flag now contains the information on whether the data this QArrayData points to is mutable. This decouples the mutability / immutability setting from the allocation and from the type of data, opening the way for mutable raw or foreign data. There are still plenty of places in the source code that check the size of the allocation when it actually wants d->isMutable(). Fixing this will require reviewing all the code, so is left for later. The needsDetach() function is moved to QArrayData and de-constified. It returns true when a reallocation is necessary if the data is to be modified. Change-Id: I17e2bc5a3f6ef1f3eba8a205acd9852b95524f57 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Introduce flags to indicate the QArrayData typeThiago Macieira2019-12-071-16/+26
| | | | | | | | | | | | | | | | | These flags allow us to determine what type of data QArrayData is carrying. There are currently only two supported types: - raw data type: constructed via fromRawData or static data - allocated data type: regular data done via heap allocation The QArrayData object is usually allocated on the heap, unless its own reference count is -1 (indicating static const QArrayData). Such object should have a type of RawDataType, since we can't call free(). Add GrowsBackward for completeness as well as the StaticDataFlags default for static data. Change-Id: Icc915a468a2acf2eae91a94e82451f852d382c92 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Introduce QArrayData::allocatedCapacity() and use it instead of d->allocThiago Macieira2019-12-071-2/+12
| | | | | | | | | | | | | | | | In almost all cases, use d->allocatedCapacity() or d->constAllocatedCapacity() instead of d->alloc, since they do the same thing (right now). In the future, the functions will be changed. There is a separate const version because most const code should not need to know the allocation size -- only mutating code should need to know that There are a few cases where d->alloc was replaced with a better alternative, like d->size. The one case that remains in the code will be replaced by a different test when it's available. Change-Id: I48135469db4caf150f82df93fff42d2309b23719 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Replace QArrayData::capacityReserved with a full flags fieldThiago Macieira2019-12-071-6/+6
| | | | | | | | | | | | | Instead of stealing one bit from the alloc field, let's use a full 32-bit for the flags. The first flag to be in the field is the CapacityReserved (even though the allocate() function will store some others there, not relevant for now). This is done in preparation for the need for more flags necessary anyway. Change-Id: I4c997d14743495e0d4558a6fb0a6042eb3d4975d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Rename QArrayData::AllocateOptions enum and update some flagsThiago Macieira2019-12-071-15/+17
| | | | | | | | | | | | | | | | Rename to QArrayData::ArrayOptions in preparation for these flags being in the array itself, instead of used just for allocating new ones. For that reason, rename QArrayData::Default to DefaultAllocationFlags. And introduce QArray::DefaultRawFlags to mean the flags needed for creating a raw (static) QArrayData. Also rename QArrayData::Grow to GrowsForward, so we may add GrowsBackward in the future. Change-Id: I536d9b34124f775d53cf810f62d6b0eaada8daef Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add QArrayData::sharedNullData()Thiago Macieira2019-12-071-0/+12
| | | | | | | | | | | | | Just to simplify a few operations, like detecting when a QChar* or char* coming from a QString or QByteArray, respectively, were null data. While you're not supposed to dereference the pointer returned by QVector::data() unless you know that the array is non-empty, that is permitted for QString and QByteArray. That is, QString().constData() must return a valid pointer to a null QChar. Change-Id: I80b4b62f203dc841e5c99c20c51d92ca576e4bfe Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Tell the compiler that QArrayData::allocate allocates memoryThiago Macieira2019-12-071-1/+5
| | | | | | | | | | ICC, GCC and Clang support __attribute__((malloc)) that tells them that the function returns newly allocated memory which doesn't alias anything else. Though technically we may return memory that has already been used (the shared null or such), that should not be a problem. Change-Id: Id3d5c7bf4d4c45069621ffff13f7f81f8b08ea3d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Tell the compiler that QArrayData returns aligned pointersThiago Macieira2019-12-071-4/+11
| | | | | | | | | | | GCC 4.9 and later support the __attribute__((alloc_align)) attributes that indicate the alignment of the data. To make it work on GCC since 4.7 and Clang as of 3.6, we instead use __builtin_assume_aligned(). I don't know which version of ICC first implemented this, but ICC 15 does and it also reports itself as GCC 4.9. Change-Id: I58bd914b9bdd0ed3349ba56fa78220ab06114852 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Get rid of unsharable containersLars Knoll2019-10-301-11/+0
| | | | | | | | The support for unsharable containers has been deprecated since Qt 5.3.0, so let's finally remove support for them. Change-Id: I9be31f55208ae4750e8020b10b6e4ad7e8fb3e0e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Replace Q_ALIGNOF usage in qtbase with C++11 alignof keywordVolker Hilsheimer2019-10-291-3/+3
| | | | | | | | | | | | | | | | The macro is not documented, so not part of the public Qt API. It is made obsolete by the alignof keyword in C++11. Remove the usage of the macro across qtbase, in particular the workarounds for compilers that didn't support alignof, and that will not be supported in Qt 6. The macro definition is left in place, no need to break existing code. Task-number: QTBUG-76414 Change-Id: I1cfedcd4dd748128696cdfb546d97aae4f98c3da Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Q_ARRAY_LITERAL: protect the check for literal typesGiuseppe D'Angelo2019-07-061-1/+7
| | | | | | | | | | Some compilers (hello, MSVC) do not produce literal types in Qt because their constexpr support has been blacklisted. Therefore, amend the check for literal types in Q_ARRAY_LITERAL: only do the check if the compiler supports constexpr. Change-Id: I7cffe00dde447d975aa6a7d02248df9c351508ff Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Q_ARRAY_LITERAL: fix the checks on the payload's datatypeGiuseppe D'Angelo2019-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The check was a misnomer -- non-POD types can go in unions since C++11. And we may want them, e.g. types without a trivial default constructor. What we really want is to check for a literal type (so that the array payload can be built entirely at compile time, and put in .rodata). So, amend the check. Also, make the dummy array constexpr, to be sure that we are indeed building the payload using constexpr constructors. That would make the first check redundant, but the fact that we're still using a macro for constexpr makes me think that not all compilers support it, so I'm leaving the first check in... Change-Id: I9f1473aa74dff5b6b6535ae4cd8325451c0b18e6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Remove handling of missing very old compiler feature checkAllan Sandfeld Jensen2019-04-061-30/+0
| | | | | | | | | | | Removes handling of missing Q_COMPILER_NULLPTR, Q_COMPILER_AUTODECL, Q_COMPILER_LAMBDA, Q_COMPILER_VARIADIC_MACROS and Q_COMPILER_AUTO_FUNCTION. We haven't supported any compilers without these for a long time. Change-Id: I3df88206516a25763e2c28b083733780f35a8764 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace Q_DECL_NOEXCEPT with noexcept in corelibAllan Sandfeld Jensen2019-04-031-5/+5
| | | | | | | In preparation of Qt6 move away from pre-C++11 macros. Change-Id: I44126693c20c18eca5620caab4f7e746218e0ce3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* implement non-member operator+ for iteratorsEric Lemanissier2018-03-061-0/+2
| | | | | | | | | all of these iterator classes already have a member operator+, which allows iter+int. This commits addes non-member operator+, which allows int+iter, and forwards to the member QList and QArrayData iterators now satisfy RandomAccessIterator concept Change-Id: I25c1dd8cea299e735d5a5e288dbe23dc1d7a1933 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>