Skip to content

Commit e9a541b

Browse files
committed
[Fix] Review and modify the comment.
1 parent a71cf5a commit e9a541b

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

src/content/docs/cpp/comments.mdx renamed to src/content/docs/cpp/language/comments.mdx

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
11
---
22
title: Comments
33
description: Auto‑generated from cppreference
4+
cppdoc:
5+
keys: ["cpp.lang.comments"]
46
---
57

68
import { Desc, DescList, DocLink } from '@components/index';
7-
8-
# Comments
9+
import { Decl, DeclDoc } from "@components/decl-doc";
910

1011
Comments serve as a sort of in-code documentation. When inserted into a program, they are effectively ignored by the compiler; they are solely intended to be used as notes by the humans that read source code. Although specific documentation is not part of the C++ standard, several utilities exist that parse comments with different documentation formats.
1112

1213
## Syntax
1314

14-
#### Block Comment
15-
Often known as "C-style" or "multi-line" comments.
16-
17-
```
18-
/* comment */
19-
```
20-
#### Single-line Comment
21-
Often known as "C++-style" or "single-line" comments.
22-
```
23-
// comment
24-
```
15+
<DeclDoc>
16+
<Decl slot="decl">
17+
```cpp
18+
/* comment */
19+
```
20+
</Decl>
21+
22+
Often known as "C-style" or "multi-line" comments.
23+
</DeclDoc>
24+
25+
<DeclDoc>
26+
<Decl slot="decl">
27+
```cpp
28+
// comment
29+
```
30+
</Decl>
31+
Often known as "C++-style" or "single-line" comments.
32+
</DeclDoc>
2533

2634
All comments are removed from the program at <DocLink src="/cpp/language/translation_phases">translation phase 3</DocLink> by replacing each comment with a single whitespace character.
2735

0 commit comments

Comments
 (0)