summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qiterable.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qiterable.h')
-rw-r--r--src/corelib/kernel/qiterable.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/corelib/kernel/qiterable.h b/src/corelib/kernel/qiterable.h
index 494cec73a3f..a5a5b35924a 100644
--- a/src/corelib/kernel/qiterable.h
+++ b/src/corelib/kernel/qiterable.h
@@ -8,10 +8,6 @@
#include <QtCore/qtypeinfo.h>
#include <QtCore/qtaggedpointer.h>
-#if !defined(QT_LEAN_HEADERS) || QT_LEAN_HEADERS < 1
-# include <QtCore/qmetacontainer.h>
-#endif
-
QT_BEGIN_NAMESPACE
namespace QtPrivate {
@@ -65,7 +61,13 @@ namespace QtPrivate {
}
};
- Q_CORE_EXPORT void warnSynthesizedAccess(const char *text);
+ enum class SynthesizedAccessFunction: quint8
+ {
+ IterableSize,
+ SequenceAt
+ };
+
+ Q_CORE_EXPORT void warnSynthesizedIterableAccess(SynthesizedAccessFunction function);
}
template<class Iterator, typename IteratorCategory>
@@ -75,7 +77,7 @@ public:
using iterator_category = IteratorCategory;
QTaggedIterator(Iterator &&it) : Iterator(std::move(it))
{
- const auto metaContainer = this->metaContainer();
+ [[maybe_unused]] const auto metaContainer = this->metaContainer();
if constexpr (std::is_base_of_v<std::random_access_iterator_tag, IteratorCategory>) {
if (!metaContainer.hasRandomAccessIterator()) {
qFatal("You cannot use this iterator as a random access iterator");
@@ -103,8 +105,6 @@ public:
this->clearIterator();
}
}
-
- Q_UNUSED(metaContainer); // in case none of the above apply
}
bool operator==(const QTaggedIterator &o) const { return Iterator::operator==(o); }
@@ -506,8 +506,8 @@ public:
// We shouldn't second-guess the underlying container, so we're not synthesizing a size.
return -1;
#else
- QtPrivate::warnSynthesizedAccess(
- "size() called on an iterable without native size accessor. This is slow");
+ QtPrivate::warnSynthesizedIterableAccess(
+ QtPrivate::SynthesizedAccessFunction::IterableSize);
if (!m_metaContainer.hasConstIterator())
return -1;