Skip to content

Commit df5624b

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#3190 from mnatsuhara/patch-1
correct "friend class" syntax
2 parents 8ddcc30 + d62fc39 commit df5624b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/cpp/friend-cpp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ friend F;
4444

4545
The first form introduces a new class F if no existing class by that name was found in the innermost namespace. **C++11**: The second form does not introduce a new class; it can be used when the class has already been declared, and it must be used when declaring a template type parameter or a typedef as a friend.
4646

47-
Use `class friend F` when the referenced type has not yet been declared:
47+
Use `friend class F` when the referenced type has not yet been declared:
4848

4949
```cpp
5050
namespace NS
5151
{
5252
class M
5353
{
54-
class friend F; // Introduces F but doesn't define it
54+
friend class F; // Introduces F but doesn't define it
5555
};
5656
}
5757
```

0 commit comments

Comments
 (0)