diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2025-02-06 08:15:36 +0100 |
|---|---|---|
| committer | Topi Reinio <topi.reinio@qt.io> | 2025-02-28 13:51:18 +0000 |
| commit | b7a67b46e66f161def5bf879f19c66d3fcec1d8b (patch) | |
| tree | feb68ba2f835a8aeced04ad3563230db49ecb011 /src/corelib/text/qstring.cpp | |
| parent | 6f89357f59b507c0dcdc177bc1ecfbbc94d6fed3 (diff) | |
Long live \constraints!
We have divergence in the way we document function, operator and
constructor constraints. About half use \note, while the other
doesn't. Some say "if and only if" while others say just "participates
only if".
So add a qdoc macro, \constraints, to semantically mark up these
constraints. It expands to a section titled `Constraints`, and
uses a predefined sentence (prefix) for constraints.
Documentation for constraints is moved to the end of the comment
blocks to separate them from the rest of the text.
Apply them to all the standard-ish constraint documentation blocks
(grepped for "participate"). I didn't look for other, one-off, ways
documentation authors may have documented constraints, but I'm also
not aware of any.
Re-wrap lines only if the result fits into a single line.
As a drive-by, drop additional "if"s, as in "only if X and -if- Y" to
make the texts work with the `Constraints` section.
Fixes: QTBUG-106871
Pick-to: 6.9 6.8 6.5
Change-Id: I18c2f9f734474017264e49165389f8c9c7f34030
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
| -rw-r--r-- | src/corelib/text/qstring.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index be7069c2e8e..1b5a7a176e0 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -3374,7 +3374,10 @@ QString &QString::append(QChar ch) resulting string, exceeds the capacity of this string, or if this string is shared. - \note This function overload only participates in overload resolution if + \note The behavior is undefined if either argument is an iterator into *this or + [\a first, \a last) is not a valid range. + + \constraints \c InputIterator meets the requirements of a \l {https://en.cppreference.com/w/cpp/named_req/InputIterator} {LegacyInputIterator} and the \c{value_type} of \c InputIterator is one of the following character types: @@ -3389,9 +3392,6 @@ QString &QString::append(QChar ch) \li (on platforms, such as Windows, where it is a 16-bit type) \c wchar_t \li \c char32_t \endlist - - \note The behavior is undefined if either argument is an iterator into *this or - [\a first, \a last) is not a valid range. */ QString &QString::assign(QAnyStringView s) |
