diff options
Diffstat (limited to 'src/corelib/text/qstringtokenizer.h')
-rw-r--r-- | src/corelib/text/qstringtokenizer.h | 47 |
1 files changed, 6 insertions, 41 deletions
diff --git a/src/corelib/text/qstringtokenizer.h b/src/corelib/text/qstringtokenizer.h index d14099ffbb..7a627b4508 100644 --- a/src/corelib/text/qstringtokenizer.h +++ b/src/corelib/text/qstringtokenizer.h @@ -1,46 +1,11 @@ -/**************************************************************************** -** -** Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QSTRINGTOKENIZER_H #define QSTRINGTOKENIZER_H #include <QtCore/qnamespace.h> #include <QtCore/qcontainerfwd.h> +#include <iterator> QT_BEGIN_NAMESPACE @@ -168,7 +133,7 @@ namespace Tok { template <typename String> struct ViewForImpl {}; template <> struct ViewForImpl<QStringView> { using type = QStringView; }; - template <> struct ViewForImpl<QLatin1String> { using type = QLatin1String; }; + template <> struct ViewForImpl<QLatin1StringView> { using type = QLatin1StringView; }; template <> struct ViewForImpl<QChar> { using type = QChar; }; template <> struct ViewForImpl<QString> : ViewForImpl<QStringView> {}; template <> struct ViewForImpl<QLatin1Char> : ViewForImpl<QChar> {}; @@ -185,7 +150,7 @@ namespace Tok { #endif // This metafunction maps a StringLike to a View (currently, QChar, - // QStringView, QLatin1String). This is what QStringTokenizerBase + // QStringView, QLatin1StringView). This is what QStringTokenizerBase // operates on. QStringTokenizer adds pinning to keep rvalues alive // for the duration of the algorithm. template <typename String> @@ -292,7 +257,7 @@ class QStringTokenizer using if_haystack_not_pinned = typename if_haystack_not_pinned_impl<Container, HPin>::type; template <typename Container, typename Iterator = decltype(std::begin(std::declval<Container>()))> using if_compatible_container = typename std::enable_if< - std::is_same< + std::is_convertible< typename Base::value_type, typename std::iterator_traits<Iterator>::value_type >::value, |