QCbor/QJson: s/QPair/std::pair/

Also port qMakePair() to just braced initialization and CTAD.

Task-number: QTBUG-115841
Change-Id: I9eafb20ebc63bd33eb52661f4f14ad2db9fc0f00
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 4be8755151e3433357de6479d5c70582f83485e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2023-12-12 10:06:19 +01:00 committed by Qt Cherry-pick Bot
parent 6b228565cf
commit 4e8e6a1526
3 changed files with 10 additions and 10 deletions

View File

@ -20,7 +20,7 @@ class QCborContainerPrivate;
class Q_CORE_EXPORT QCborMap class Q_CORE_EXPORT QCborMap
{ {
public: public:
typedef QPair<QCborValue, QCborValue> value_type; typedef std::pair<QCborValue, QCborValue> value_type;
typedef QCborValue key_type; typedef QCborValue key_type;
typedef QCborValue mapped_type; typedef QCborValue mapped_type;
typedef qsizetype size_type; typedef qsizetype size_type;
@ -34,9 +34,9 @@ public:
public: public:
typedef std::random_access_iterator_tag iterator_category; typedef std::random_access_iterator_tag iterator_category;
typedef qsizetype difference_type; typedef qsizetype difference_type;
typedef QPair<QCborValueConstRef, QCborValueRef> value_type; typedef std::pair<QCborValueConstRef, QCborValueRef> value_type;
typedef QPair<QCborValueConstRef, QCborValueRef> reference; typedef std::pair<QCborValueConstRef, QCborValueRef> reference;
typedef QPair<QCborValueConstRef, QCborValueRef> pointer; typedef std::pair<QCborValueConstRef, QCborValueRef> pointer;
constexpr Iterator() = default; constexpr Iterator() = default;
constexpr Iterator(const Iterator &) = default; constexpr Iterator(const Iterator &) = default;
@ -94,9 +94,9 @@ public:
public: public:
typedef std::random_access_iterator_tag iterator_category; typedef std::random_access_iterator_tag iterator_category;
typedef qsizetype difference_type; typedef qsizetype difference_type;
typedef QPair<QCborValueConstRef, QCborValueConstRef> value_type; typedef std::pair<QCborValueConstRef, QCborValueConstRef> value_type;
typedef QPair<QCborValueConstRef, QCborValueConstRef> reference; typedef std::pair<QCborValueConstRef, QCborValueConstRef> reference;
typedef QPair<QCborValueConstRef, QCborValueConstRef> pointer; typedef std::pair<QCborValueConstRef, QCborValueConstRef> pointer;
constexpr ConstIterator() = default; constexpr ConstIterator() = default;
constexpr ConstIterator(const ConstIterator &) = default; constexpr ConstIterator(const ConstIterator &) = default;

View File

@ -85,7 +85,7 @@ QT_BEGIN_NAMESPACE
QJsonObject::QJsonObject() = default; QJsonObject::QJsonObject() = default;
/*! /*!
\fn QJsonObject::QJsonObject(std::initializer_list<QPair<QString, QJsonValue> > args) \fn QJsonObject::QJsonObject(std::initializer_list<std::pair<QString, QJsonValue> > args)
\since 5.4 \since 5.4
Constructs a QJsonObject instance initialized from \a args initialization list. Constructs a QJsonObject instance initialized from \a args initialization list.
For example: For example:
@ -111,7 +111,7 @@ QJsonObject::QJsonObject(QCborContainerPrivate *object)
*/ */
QJsonObject::~QJsonObject() = default; QJsonObject::~QJsonObject() = default;
QJsonObject::QJsonObject(std::initializer_list<QPair<QString, QJsonValue> > args) QJsonObject::QJsonObject(std::initializer_list<std::pair<QString, QJsonValue> > args)
{ {
for (const auto &arg : args) for (const auto &arg : args)
insert(arg.first, arg.second); insert(arg.first, arg.second);

View File

@ -21,7 +21,7 @@ class Q_CORE_EXPORT QJsonObject
public: public:
QJsonObject(); QJsonObject();
QJsonObject(std::initializer_list<QPair<QString, QJsonValue> > args); QJsonObject(std::initializer_list<std::pair<QString, QJsonValue> > args);
~QJsonObject(); ~QJsonObject();