Title: How should we annotate version-specific optional syntax element? · Issue #85 · cppdoc-cc/cppdoc · GitHub
Open Graph Title: How should we annotate version-specific optional syntax element? · Issue #85 · cppdoc-cc/cppdoc
X Title: How should we annotate version-specific optional syntax element? · Issue #85 · cppdoc-cc/cppdoc
Description: 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...
Open Graph Description: 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 de...
X Description: 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 de...
Opengraph URL: https://github.com/cppdoc-cc/cppdoc/issues/85
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How should we annotate version-specific optional syntax element?","articleBody":"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.\n\n\u003cimg width=\"564\" height=\"113\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/0270c762-de23-4e49-afa8-3f236fb26a28\" /\u003e\n\nIn 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.\n\n\u003cimg width=\"734\" height=\"815\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/4f233060-f8a9-4479-ac75-ded3764a1cdd\" /\u003e\n\nHowever, this approach becomes cumbersome and visually complex, especially for intricate syntax, as shown in the examples below.\n\n\u003cimg width=\"718\" height=\"557\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/728cde6c-86f8-4ff2-b43e-d209599a7824\" /\u003e\n\nHow should we deal with that?\n","author":{"url":"https://github.com/Sudrut","@type":"Person","name":"Sudrut"},"datePublished":"2025-12-18T15:19:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/85/cppdoc/issues/85"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:561862fe-9c5e-e640-09ed-e0b542927597 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E0F4:2DF2F1:296105:3A829D:6978B182 |
| html-safe-nonce | 934de41761600da3ba6d54a85033fcdf126d115477854212c524773bf314980b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMEY0OjJERjJGMToyOTYxMDU6M0E4MjlEOjY5NzhCMTgyIiwidmlzaXRvcl9pZCI6IjUwMTUwNTMwMjM0NjY1MzMyNTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ae60f97dddc5e1806ae520a64b53d141e2a9080122fb2fb1f7cd0938937495e7 |
| hovercard-subject-tag | issue:3743606785 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cppdoc-cc/cppdoc/85/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cc4b66b3197718a59f58a203398a020986b96b7925090d7b1c51ce3bf2f04617/cppdoc-cc/cppdoc/issues/85 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cc4b66b3197718a59f58a203398a020986b96b7925090d7b1c51ce3bf2f04617/cppdoc-cc/cppdoc/issues/85 |
| og:image:alt | 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 de... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Sudrut |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2981c597c945c1d90ac6fa355ce7929b2f413dfe7872ca5c435ee53a24a1de50 |
| turbo-cache-control | no-preview |
| go-import | github.com/cppdoc-cc/cppdoc git https://github.com/cppdoc-cc/cppdoc.git |
| octolytics-dimension-user_id | 246953543 |
| octolytics-dimension-user_login | cppdoc-cc |
| octolytics-dimension-repository_id | 1103268484 |
| octolytics-dimension-repository_nwo | cppdoc-cc/cppdoc |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1103268484 |
| octolytics-dimension-repository_network_root_nwo | cppdoc-cc/cppdoc |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8aa86d87c47054170094daaf9699b27a28a8448 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width