You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How should we annotate version-specific optional syntax element? #85
The syntax form for many features includes optional components that are only valid in newer language/library versions, but these are not explicitly marked. For example, in the syntax of function definition the syntax element attr is only valid since C++11, and contract-specs is introduced in C++26.
In cppdoc, readers can select a specific C++ revision. The intuitive expectation is that features not available in the selected revision should be hidden. To achieve this during migration of docs for function, I have “divided” the syntax description into multiple revision-specific blocks.
However, this approach becomes cumbersome and visually complex, especially for intricate syntax, as shown in the examples below.
changed the title [-]How should we annotate version-specific optional syntax element in C++ documentation?[/-][+]How should we annotate version-specific optional syntax element?[/+]on Dec 18, 2025
This actually looks good to me, since cppreference takes a similar style to format this. If you want to try more, I suggest try use a tab panel for this, with each tab showing the syntax for a specific range of revisions.
Activity
[-]How should we annotate version-specific optional syntax element in C++ documentation?[/-][+]How should we annotate version-specific optional syntax element?[/+]Lancern commentedon Dec 19, 2025
This actually looks good to me, since cppreference takes a similar style to format this. If you want to try more, I suggest try use a tab panel for this, with each tab showing the syntax for a specific range of revisions.