summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qsharedpointer.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-10-02 18:46:01 +0200
committerMarc Mutz <marc.mutz@qt.io>2024-11-08 22:48:50 +0100
commit5627e113793df3df24742d7af502a075c2c9e95d (patch)
tree37d3fefcf962f491bb8e8bf3d4a866b5ca3f9573 /src/corelib/tools/qsharedpointer.cpp
parent720ce9b97b767fdf36eaf78107b23bd017e191f3 (diff)
Create qdoc macros for C++ class docs 1.2: member-swap(), simplified phrasing
We have some patterns for how to document certain functions, but we also vary the sentences a lot, and you have to look up one documentation piece and copy it, essentially. If we ever want to change them, we end up with shotgun surgery. So apply DRY to the documentation and start a collection of macros to help with repetitive C++ class documentation tasks. The first macro is for member-swap(), and this second patch is for documentation that used the simplified phrasing ("Swaps this X with \a other."), which this patch adopts as the text for \memberswap, too, because it doesn't repeat the macro argument, making it easier to find a grammatically-fitting argument than in the traditional phrasing. This doesn't change the documentation, except as follows: * standardizes on simpified instead of traditional phrasing for docs that already use the \memberswap macro * adds the "very fast and never fails" blurb, if it was missing * changes the function's argument name to `other`, as required by the macro. Task-number: QTBUG-129573 Pick-to: 6.8 6.7 6.5 6.2 Change-Id: I1123e783ce0da76c5997ff74007d77504ac5b334 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/corelib/tools/qsharedpointer.cpp')
-rw-r--r--src/corelib/tools/qsharedpointer.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index 9ed48338e99..b1d6e80d1ae 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -527,9 +527,7 @@
/*!
\fn template <class T> void QSharedPointer<T>::swap(QSharedPointer<T> &other);
\since 5.3
-
- Swaps this shared pointer instance with \a other. This function is
- very fast and never fails.
+ \memberswap{shared pointer instance}
*/
/*!
@@ -848,9 +846,7 @@
/*!
\fn template <class T> void QWeakPointer<T>::swap(QWeakPointer<T> &other)
\since 5.4
-
- Swaps this weak pointer instance with \a other. This function is
- very fast and never fails.
+ \memberswap{weak pointer instance}
*/
/*!