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: patch-diff.githubusercontent.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:5aadfb26-a914-36e3-7634-3270582691ab |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ACF8:2BFBA0:21B18D6:2FD76CA:6978FA22 |
| html-safe-nonce | 927ab019db3a154e57ddd95342f43214988b1b82988368edf5f25a77936957a5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0Y4OjJCRkJBMDoyMUIxOEQ2OjJGRDc2Q0E6Njk3OEZBMjIiLCJ2aXNpdG9yX2lkIjoiNDAzMzg0NDA3NTEzMDU4MzU4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8312b3195c56be613e8f6b1e7f935c9ef717b3e4d5b4e24113d62626964ac0d2 |
| 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 | 6d9b384ce19e0ac9756580c70eae9a3359939e77ff05c731561090d13085b2b7 |
| 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 | 56ad33f6fdc0d0fb49c96b3c46ed74c55d926471 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width