diff options
Diffstat (limited to 'src/corelib/tools/qstringview.h')
-rw-r--r-- | src/corelib/tools/qstringview.h | 4 |
1 files changed, 4 insertions, 0 deletions
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 <typename Char, if_compatible_char<Char> = true> + Q_DECL_CONSTEXPR QStringView(const Char *f, const Char *l) + : QStringView(f, l - f) {} + #ifdef Q_QDOC template <typename Char, size_t N> Q_DECL_CONSTEXPR QStringView(const Char (&array)[N]) Q_DECL_NOTHROW; |