QRegularExpression: add move constructor(s)

Change-Id: I599e4b7338172de5936b191f5e16383c1c31104c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2020-09-29 18:30:04 +02:00
parent e60a337f4e
commit 733ab10961
2 changed files with 44 additions and 0 deletions

View File

@ -1362,6 +1362,16 @@ QRegularExpression::QRegularExpression(const QRegularExpression &re)
{ {
} }
/*!
\fn QRegularExpression::QRegularExpression(QRegularExpression &&re)
Constructs a QRegularExpression object by moving from \a re.
\since 6.0
\sa operator=
*/
/*! /*!
Destroys the QRegularExpression object. Destroys the QRegularExpression object.
*/ */
@ -1369,6 +1379,8 @@ QRegularExpression::~QRegularExpression()
{ {
} }
QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QRegularExpressionPrivate)
/*! /*!
Assigns the regular expression \a re to this object, and returns a reference Assigns the regular expression \a re to this object, and returns a reference
to the copy. Both the pattern and the pattern options are copied. to the copy. Both the pattern and the pattern options are copied.
@ -2018,6 +2030,8 @@ QRegularExpressionMatch::~QRegularExpressionMatch()
{ {
} }
QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QRegularExpressionMatchPrivate)
/*! /*!
Constructs a match result by copying the result of the given \a match. Constructs a match result by copying the result of the given \a match.
@ -2028,6 +2042,16 @@ QRegularExpressionMatch::QRegularExpressionMatch(const QRegularExpressionMatch &
{ {
} }
/*!
\fn QRegularExpressionMatch::QRegularExpressionMatch(QRegularExpressionMatch &&re)
Constructs a match result by moving from the given \a match.
\since 6.0
\sa operator=()
*/
/*! /*!
Assigns the match result \a match to this object, and returns a reference Assigns the match result \a match to this object, and returns a reference
to the copy. to the copy.
@ -2450,6 +2474,8 @@ QRegularExpressionMatchIterator::~QRegularExpressionMatchIterator()
{ {
} }
QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QRegularExpressionMatchIteratorPrivate)
/*! /*!
Constructs a QRegularExpressionMatchIterator object as a copy of \a Constructs a QRegularExpressionMatchIterator object as a copy of \a
iterator. iterator.
@ -2461,6 +2487,17 @@ QRegularExpressionMatchIterator::QRegularExpressionMatchIterator(const QRegularE
{ {
} }
/*!
\fn QRegularExpressionMatchIterator::QRegularExpressionMatchIterator(QRegularExpressionMatchIterator &&iterator)
Constructs a QRegularExpressionMatchIterator object by moving from \a
iterator.
\since 6.0
\sa operator=()
*/
/*! /*!
Assigns the iterator \a iterator to this object, and returns a reference to Assigns the iterator \a iterator to this object, and returns a reference to
the copy. the copy.

View File

@ -60,6 +60,8 @@ class QRegularExpressionMatchIterator;
struct QRegularExpressionPrivate; struct QRegularExpressionPrivate;
class QRegularExpression; class QRegularExpression;
QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QRegularExpressionPrivate, Q_CORE_EXPORT)
Q_CORE_EXPORT size_t qHash(const QRegularExpression &key, size_t seed = 0) noexcept; Q_CORE_EXPORT size_t qHash(const QRegularExpression &key, size_t seed = 0) noexcept;
class Q_CORE_EXPORT QRegularExpression class Q_CORE_EXPORT QRegularExpression
@ -86,6 +88,7 @@ public:
QRegularExpression(); QRegularExpression();
explicit QRegularExpression(const QString &pattern, PatternOptions options = NoPatternOption); explicit QRegularExpression(const QString &pattern, PatternOptions options = NoPatternOption);
QRegularExpression(const QRegularExpression &re); QRegularExpression(const QRegularExpression &re);
QRegularExpression(QRegularExpression &&re) = default;
~QRegularExpression(); ~QRegularExpression();
QRegularExpression &operator=(const QRegularExpression &re); QRegularExpression &operator=(const QRegularExpression &re);
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QRegularExpression) QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QRegularExpression)
@ -199,6 +202,7 @@ Q_CORE_EXPORT QDebug operator<<(QDebug debug, QRegularExpression::PatternOptions
#endif #endif
struct QRegularExpressionMatchPrivate; struct QRegularExpressionMatchPrivate;
QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QRegularExpressionMatchPrivate, Q_CORE_EXPORT)
class Q_CORE_EXPORT QRegularExpressionMatch class Q_CORE_EXPORT QRegularExpressionMatch
{ {
@ -206,6 +210,7 @@ public:
QRegularExpressionMatch(); QRegularExpressionMatch();
~QRegularExpressionMatch(); ~QRegularExpressionMatch();
QRegularExpressionMatch(const QRegularExpressionMatch &match); QRegularExpressionMatch(const QRegularExpressionMatch &match);
QRegularExpressionMatch(QRegularExpressionMatch &&match) = default;
QRegularExpressionMatch &operator=(const QRegularExpressionMatch &match); QRegularExpressionMatch &operator=(const QRegularExpressionMatch &match);
QRegularExpressionMatch &operator=(QRegularExpressionMatch &&match) noexcept QRegularExpressionMatch &operator=(QRegularExpressionMatch &&match) noexcept
{ d.swap(match.d); return *this; } { d.swap(match.d); return *this; }
@ -273,6 +278,7 @@ class QRegularExpressionMatchIteratorRangeBasedForIteratorSentinel {};
} }
struct QRegularExpressionMatchIteratorPrivate; struct QRegularExpressionMatchIteratorPrivate;
QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QRegularExpressionMatchIteratorPrivate, Q_CORE_EXPORT)
class Q_CORE_EXPORT QRegularExpressionMatchIterator class Q_CORE_EXPORT QRegularExpressionMatchIterator
{ {
@ -280,6 +286,7 @@ public:
QRegularExpressionMatchIterator(); QRegularExpressionMatchIterator();
~QRegularExpressionMatchIterator(); ~QRegularExpressionMatchIterator();
QRegularExpressionMatchIterator(const QRegularExpressionMatchIterator &iterator); QRegularExpressionMatchIterator(const QRegularExpressionMatchIterator &iterator);
QRegularExpressionMatchIterator(QRegularExpressionMatchIterator &&iterator) = default;
QRegularExpressionMatchIterator &operator=(const QRegularExpressionMatchIterator &iterator); QRegularExpressionMatchIterator &operator=(const QRegularExpressionMatchIterator &iterator);
QRegularExpressionMatchIterator &operator=(QRegularExpressionMatchIterator &&iterator) noexcept QRegularExpressionMatchIterator &operator=(QRegularExpressionMatchIterator &&iterator) noexcept
{ d.swap(iterator.d); return *this; } { d.swap(iterator.d); return *this; }