Skip to content

Commit 6734b74

Browse files
committed
fix: improve the styles and fix typo
1 parent 701ae82 commit 6734b74

File tree

2 files changed

+37
-22
lines changed

2 files changed

+37
-22
lines changed

src/content/docs/cpp/language/preprocessor.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: preprocessor
2+
title: Preprocessor
33
cppdoc:
44
keys: ["cpp.lang.preprocessor"]
55
---

src/content/docs/cpp/language/templates.mdx

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,25 @@ The definition of a class template must be visible at the point of implicit inst
3838

3939
<DeclDoc>
4040
<Decl slot="decl">
41-
```cpp
42-
template <parameter-list> requires-clause(optional)</span> declaration
41+
```cpp cxx-mark
42+
template </*$s:parameter-list*/> /*$s:requires-clause*//*$opt*//*$s:declaration*/
4343
```
4444
</Decl>
4545
</DeclDoc>
4646

4747
<DeclDoc>
4848
<Decl slot="decl">
49-
```cpp
50-
export template <parameter-list> declaration
49+
```cpp cxx-mark
50+
export template </*$s:parameter-list*/> /*$s:requires-clause*//*$opt*//*$s:declaration*/
5151
```
5252
</Decl>
5353
<Revision until="C++11"></Revision>
5454
</DeclDoc>
5555

5656
<DeclDoc>
5757
<Decl slot="decl">
58-
```cpp
59-
template <parameter-list> concept concept-name = constraint-expression;
58+
```cpp cxx-mark
59+
template </*$s:parameter-list*/> concept /*$s:concept-name*/ = /*$s:constraint-expression*/;
6060
```
6161
</Decl>
6262
<Revision since="C++20"></Revision>
@@ -65,18 +65,15 @@ The definition of a class template must be visible at the point of implicit inst
6565

6666
<ParamDocList>
6767
<ParamDoc name="parameter-list">
68-
a non-empty comma-separated list of the template parameters, each of which is either constant parameter, a type parameter, a template parameter, or a parameter pack of any of those(since C++11).
68+
a non-empty comma-separated list of the <DocLink dest="/cpp/language/template_parameters">template parameters</DocLink>, each of which is either <DocLink dest="/cpp/language/template_parameters#Constant_template_parameters">constant parameter</DocLink>, a <DocLink dest="/cpp/language/template_parameters#Type_template_parameters">type parameter</DocLink>, a <DocLink dest="/cpp/language/template_parameters#Template_template_parameters">template parameter</DocLink><Revision since="C++11">, or a <DocLink dest="/cpp/language/parameter_pack">parameter pack</DocLink> of any of those</Revision>.
6969
</ParamDoc>
7070
<ParamDoc name="requires-clause">
71-
(since C++20) a requires-clause that specifies the constraints on the template arguments.
71+
<Revision since="C++20">a <DocLink dest="/cpp/language/constraints#requires-clauses">requires-clause</DocLink> that specifies the <DocLink dest="/cpp/language/constraints">constraints</DocLink> on the template arguments.</Revision>
7272
</ParamDoc>
7373
<ParamDoc name="declaration">
74-
declaration of a class (including struct and union), a member class or member enumeration type, a function or member function, a static data member at namespace scope, a variable or static data member at class scope(since C++14), or an alias template(since C++11). It may also define a template specialization.
74+
declaration of a <DocLink dest="/cpp/language/class_template">class (including struct and union)</DocLink>, a <DocLink dest="/cpp/language/member_template">member class or member enumeration type</DocLink>, a <DocLink dest="/cpp/language/function_template">function</DocLink> or <DocLink dest="/cpp/language/member_template">member function</DocLink>, a static data member at namespace scope<Revision since="C++14">, a <DocLink dest="/cpp/language/variable_template">variable or static data member at class scope</DocLink></Revision>, <Revision since="C++11">or an <DocLink dest="/cpp/language/type_alias">alias template</DocLink></Revision>. It may also define a <DocLink dest="/cpp/language/template_specialization">template specialization</DocLink>.
7575
</ParamDoc>
76-
<ParamDoc name="concept-name">
77-
concept-name
78-
</ParamDoc>
79-
<ParamDoc name="constraint-expression">
76+
<ParamDoc name="concept-name constraint-expression">
8077
see constraints and concepts
8178
</ParamDoc>
8279
</ParamDocList>
@@ -91,41 +88,59 @@ A template identifier has one of the following syntaxes:
9188

9289
<DeclDoc>
9390
<Decl slot="decl">
94-
```cpp
95-
template-name<template-argument-list(optional)>
91+
```cpp cxx-mark
92+
/*$s:template-name*/</*$s:template-argument-list*//*$opt*/>
9693
```
9794
</Decl>
9895

9996
A *simple template identifier*.
10097
</DeclDoc>
10198
<DeclDoc>
10299
<Decl slot="decl">
103-
```cpp
104-
operator op<template-argument-list(optional)>
100+
```cpp cxx-mark
101+
operator /*$s:op*/</*$s:template-argument-list*//*$opt*/>
105102
```
106103
</Decl>
107104

108105
An operator function template identifier.
109106
</DeclDoc>
110107
<DeclDoc>
111108
<Decl slot="decl">
112-
```cpp
113-
operator "" identifier<template-argument-list(optional)>
109+
```cpp cxx-mark
110+
operator "" /*$s:identifier*/</*$s:template-argument-list*//*$opt*/>
114111
```
115112
</Decl>
116113

117114
A literal operator function template identifier. <Revision since="C++11" traits={[{ trait: "deprecated", since:"C++23"}]}></Revision>
118115
</DeclDoc>
119116
<DeclDoc>
120117
<Decl slot="decl">
121-
```cpp
122-
operator user-defined-string-literal<template-argument-list(optional)>
118+
```cpp cxx-mark
119+
operator user-defined-string-literal</*$s:template-argument-list*//*$opt*/>
123120
```
124121
</Decl>
125122

126123
A user-defined string literal operator. <Revision since="C++11"></Revision>
127124
</DeclDoc>
128125

126+
127+
<ParamDocList>
128+
<ParamDoc name="template-name">
129+
an <DocLink dest="/cpp/language/name">identifier</DocLink> that names a template
130+
</ParamDoc>
131+
<ParamDoc name="op">
132+
an <DocLink dest="/cpp/language/operators">overloadable operator</DocLink>
133+
</ParamDoc>
134+
<ParamDoc name="identifier">
135+
an identifier
136+
</ParamDoc>
137+
<ParamDoc name="user-defined-string-literal">
138+
`""` followed by an identifier
139+
</ParamDoc>
140+
</ParamDocList>
141+
142+
143+
129144
A simple template identifier that names a class template specialization names a class.
130145

131146
A template identifier that names an alias template specialization names a type.

0 commit comments

Comments
 (0)