summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstringbuilder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qstringbuilder.h')
-rw-r--r--src/corelib/tools/qstringbuilder.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index e9ca2245ba..1d96d70637 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -289,6 +289,20 @@ template <> struct QConcatenable<QStringRef> : private QAbstractConcatenable
}
};
+template <> struct QConcatenable<QStringView> : private QAbstractConcatenable
+{
+ typedef QStringView type;
+ typedef QString ConvertTo;
+ enum { ExactSize = true };
+ static int size(QStringView a) { return a.length(); }
+ static inline void appendTo(QStringView a, QChar *&out)
+ {
+ const auto n = a.size();
+ memcpy(out, a.data(), sizeof(QChar) * n);
+ out += n;
+ }
+};
+
template <int N> struct QConcatenable<const char[N]> : private QAbstractConcatenable
{
typedef const char type[N];