Skip to content

How should we annotate version-specific optional syntax element? #85

@Sudrut

Description

@Sudrut

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.

Image

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.

Image

However, this approach becomes cumbersome and visually complex, especially for intricate syntax, as shown in the examples below.

Image

How should we deal with that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions