Details
-
Suggestion
-
Resolution: Fixed
-
P2: Important
-
None
-
None
-
2
-
b7a67b46e (dev), bcdd7c260 (6.9)
-
Foundation Sprint 125, Foundation Sprint 126
Description
Constrained templates are those that either use std::enable_if (openly, or hidden in a if_x<T> = true template alias), or, come C++20, requires clauses.
We need to make sure that qdoc understands these enable_if and later requires clauses and produces sensible documentation from them.
Currently, we either ignore the issue and hope that qdoc will produce something sensible from the C++ declaration, or we fake some unconstrained versions of the function under #ifdef Q_QDOC. The former obviously works in that qdoc copied the enable_if verbatim (https://doc.qt.io/qt-6/qstringview.html#QStringView-3), but since the constraint isn't clickable, the user is left wondering what the heck that thing is. The latter is a lie to the user, and means she needs to look into the header instead of the docs when some overloading/SFINAE goes wrong for her.
So, we need to up our game here.
Please come up with a way to document concepts (not just the C++20 ones, which are a ways out, still, but also incidental C++17 ones like QStringView's if_compatible_char), get stakeholder approval, and implement what's missing in qdoc to support it.
Attachments
Issue Links
- relates to
-
QTBUG-117881 Better tools to document template parameter names and constraints
-
- Open
-
- resulted in
-
QTBUG-130889 Broken \note in https://doc.qt.io/qt-6/qspan.html#QSpan-7
-
- Closed
-
For Gerrit Dashboard: QTBUG-106871 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
628386,1 | Long live \constraints! | 6.8 | qt/qtbase | Status: NEW | 0 | 0 |