Template:ftml
Feature-testing macros support
Used to generate links and tables that describe given feature-testing macros.
One-row form
{{feature test macro|feature-test-macro-name |feature |value=date |std=C++XY |dr=yes or NN (optional)}}
Example:
{{feature test macro|__cpp_lib_string_view|{{lc|std::string_view}}|value=201606L|std=C++17}}
- results in
| Feature-test macro | Value | Std | Feature |
|---|---|---|---|
__cpp_lib_string_view |
201606L |
(C++17) | std::string_view |
Example:
{{feature test macro|__cpp_inheriting_constructors|Rewording|value=201511L|std=C++11|dr=98}}
- results in
| Feature-test macro | Value | Std | Feature |
|---|---|---|---|
__cpp_inheriting_constructors |
201511L |
(C++11) (DR98) |
Rewording |
Multi-row form
If there is more than one feature-testing macro on a page then they should be combined in a table using the following templates:
{{ftm begin|params (optional)}}
{{ftm|params }}
...
{{ftm end}}
Syntax
{{ftm begin|core=yes (optional)|sort=yes (optional)}}
Determines the table's properties.
- If the named parameter
coreis provided then a link (in the title of the table) to the library features page will not be generated. - If the named parameter
sortis provided then the table will be a "sortable" wiki-table.
- Note: Previously, two additional (optional) parameters were supported:
stdandcomment(both are ignored now), used to conditionally add/hide columns. Std, Value, and Feature columns are always present.
{{ftm|cpp-macro |feature |value=value |std=C++XX |rowspan=R (optional)|dr=yes or XZ (optional)}}
cpp-macroprovides the feature-test macro name, e.g.__cpp_lib_constexprfeatureprovides the feature descriptionvalueprovides the feature-test value (a date), e.g.202202Lstdprovides revision string, e.g. (C++23)rowspanis an optional parameter (e.g.,rowspan="3") which has the same meaning as in standard wiki-tables, i.e., if provided, it results in a vertical merging ofRadjacent cells (in Feature-test macro column) into one, with a single feature-test macro name rendered inside. The followingR - 1{{ftm}}s should go with-char instead of the macro name.dr, if provided with argument "yes", adds a (DR) mark below the C++ revision.dr, if provided with argument other than "yes", e.g. revision number98, adds a (DR98) mark below the C++ revision.
Example
The sequence
{{ftm begin|sort=yes}}
{{ftm|std=C++23|value=202207L|__cpp_lib_find_last|comment #1}}
{{ftm|std=C++23|value=202207L|__cpp_lib_fold|comment #2}}
{{ftm|std=C++20|value=201911L|__cpp_lib_ranges|rowspan="4"|comment #3}}
{{ftm|std=C++20|value=202106L|-|comment #4}}
{{ftm|std=C++20|value=202110L|-|comment #5|dr=yes}}
{{ftm|std=C++23|value=202202L|-|comment #6|dr=20}}
{{ftm|std=C++23|value=202207L|__cpp_lib_ranges_contains|comment #7}}
{{ftm|std=C++23|value=202202L|__cpp_lib_ranges_iota|comment #8}}
{{ftm|std=C++23|value=202106L|__cpp_lib_ranges_starts_ends_with|comment #9}}
{{ftm|std=C++20|value=201806L|__cpp_lib_shift|rowspan="2"|comment #10}}
{{ftm|std=C++23|value=202202L|-|comment #11}}
{{ftm end}}
results in:
| Feature-test macro | Value | Std | Feature |
|---|---|---|---|
__cpp_lib_find_last |
202207L |
(C++23) | comment #1 |
__cpp_lib_fold |
202207L |
(C++23) | comment #2 |
__cpp_lib_ranges |
201911L |
(C++20) | comment #3 |
202106L |
(C++20) | comment #4 | |
202110L |
(C++20) (DR) |
comment #5 | |
202202L |
(C++23) (DR20) |
comment #6 | |
__cpp_lib_ranges_contains |
202207L |
(C++23) | comment #7 |
__cpp_lib_ranges_iota |
202202L |
(C++23) | comment #8 |
__cpp_lib_ranges_starts_ends_with |
202106L |
(C++23) | comment #9 |
__cpp_lib_shift |
201806L |
(C++20) | comment #10 |
202202L |
(C++23) | comment #11 |
Inline forms
{{ftm link|feature-test-macro-name }}
Produces a simple link to cpp/feature test tables.
feature-test-macro-name- a FTM name, e.g.__cpp_constexpror__cpp_lib_ratio
Example:
{{ftm link|__cpp_constexpr}}results in__cpp_constexpr
{{ftml|feature-test-macro-name |since-rev (optional)|updated-in-rev-list (optional)}}
Produces a simple link with revision mark(s), designed to be used in pages such as Macro Symbol Index.
feature-test-macro-name- a FTM name, e.g.__cpp_constexpror__cpp_lib_ratiosince-rev- C++ revision in the formC++20update-in-rev-list- list of revisions where updates took place, in the formC++17, C++20
Examples
{{ftml|__cpp_constexpr}}results in__cpp_constexpr{{ftml|__cpp_constexpr|C++11}}results in__cpp_constexpr(since C++11){{ftml|__cpp_lib_format|C++20|C++23}}results in__cpp_lib_format(since C++20)(updated in C++23){{ftml|__cpp_lib_format|C++20|C++23, C++26}}results in__cpp_lib_format(since C++20)(updated in C++23, C++26)
| The above documentation is transcluded from Template:ftm/doc. (edit | history) Subpages of this template. |