From 3c592a17f1b54c88a0d868b7251f5134dac421b6 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 3 May 2017 20:11:34 +0200 Subject: QStringView: add constructor from pointer pair This is often more natural than (ptr, len), and I need it in the implementation of QStringView::trimmed(). Change-Id: I1d99b5ddaf76eee0582150b0233ef6ce9c37d25d Reviewed-by: Anton Kudryavtsev Reviewed-by: Edward Welbourne --- src/corelib/tools/qstringview.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/corelib/tools/qstringview.h') diff --git a/src/corelib/tools/qstringview.h b/src/corelib/tools/qstringview.h index 62173f9765..fdbf644518 100644 --- a/src/corelib/tools/qstringview.h +++ b/src/corelib/tools/qstringview.h @@ -176,6 +176,10 @@ public: : m_size((Q_ASSERT(len >= 0), Q_ASSERT(str || !len), len)), m_data(castHelper(str)) {} + template = true> + Q_DECL_CONSTEXPR QStringView(const Char *f, const Char *l) + : QStringView(f, l - f) {} + #ifdef Q_QDOC template Q_DECL_CONSTEXPR QStringView(const Char (&array)[N]) Q_DECL_NOTHROW; -- cgit v1.2.3