Skip to content

Commit feab217

Browse files
committed
Acrolinx fixes.
1 parent b39fea5 commit feab217

File tree

4 files changed

+23
-13
lines changed

4 files changed

+23
-13
lines changed

docs/error-messages/compiler-errors-1/compiler-error-c2248.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
---
22
description: "Learn more about: Compiler Error C2248"
33
title: "Compiler Error C2248"
4-
ms.date: "11/04/2016"
4+
ms.date: 09/27/2022
55
f1_keywords: ["C2248"]
66
helpviewer_keywords: ["C2248"]
77
ms.assetid: 7a3ba0e8-d3b9-4bb9-95db-81ef17e31d23
88
---
99
# Compiler Error C2248
1010

11-
'*member*' : cannot access '*access_level*' member declared in class '*class*'
11+
> '*member*': can't access '*access_level*' member declared in class '*class*'
1212
13-
Members of a derived class cannot access **`private`** members of a base class. You cannot access **`private`** or **`protected`** members of class instances.
13+
## Remarks
14+
15+
Members of a derived class can't access **`private`** members of a base class. You can't access **`private`** or **`protected`** members of class instances.
1416

1517
## Example
1618

17-
The following sample generates C2248 when private or protected members of a class are accessed from outside the class. To fix this issue, do not access these members directly outside the class. Use public member data and member functions to interact with the class.
19+
The following sample generates C2248 when `private` or `protected` members of a class are accessed from outside the class. To fix this issue, don't access these members directly outside the class. Use `public` member data and member functions to interact with the class.
1820

1921
```cpp
2022
// C2248_access.cpp
@@ -72,7 +74,7 @@ int main() {
7274
}
7375
```
7476

75-
Another conformance issue that exposes C2248 is when you attempt to declare a friend of a class and when the class is not visible to the friend declaration in the scope of the class. To fix this issue, grant friendship to the enclosing class.
77+
Here's another conformance issue that exposes C2248: You attempt to declare a friend of a class, but the class isn't visible to the friend declaration in the scope of the class. To fix this issue, grant friendship to the enclosing class.
7678

7779
```cpp
7880
// C2248_enclose.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2299.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ ms.assetid: d001c2bc-f6fd-47aa-8e42-0eb824d6441d
88
---
99
# Compiler Error C2299
1010

11-
'function' : behavior change: an explicit specialization can not be a copy constructor or copy assignment operator
11+
> '*function*': behavior change: an explicit specialization can not be a copy constructor or copy assignment operator
1212
13-
This error can also be generated as a result of compiler conformance work that was done for Visual Studio 2005: previous versions of Visual C++ allowed explicit specializations for a copy constructor or a copy assignment operator.
13+
## Remarks
1414

15-
To resolve C2299, do not make the copy constructor or assignment operator a function template, but rather a non-template function that takes a class type. Any code that calls the copy constructor or assignment operator by explicitly specifying the template arguments needs to remove the template arguments.
15+
This error can also be generated as a result of compiler conformance work that was done for Visual Studio 2005. Previous versions of Visual C++ allowed explicit specializations for a copy constructor or a copy assignment operator.
16+
17+
To resolve C2299, don't make the copy constructor or assignment operator a function template. Make them non-template functions that take a class type. Any code that calls the copy constructor or assignment operator by explicitly specifying the template arguments needs to remove the template arguments.
18+
19+
## Example
1620

1721
The following sample generates C2299:
1822

docs/error-messages/compiler-errors-2/compiler-error-c2701.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
description: "Learn more about: Compiler Error C2701"
33
title: "Compiler Error C2701"
4-
ms.date: "11/04/2016"
4+
ms.date: 09/27/2022
55
f1_keywords: ["C2701"]
66
helpviewer_keywords: ["C2701"]
77
ms.assetid: 31cf2ab7-ced9-4f75-aa51-e169e20407fb
88
---
99
# Compiler Error C2701
1010

11-
'function' : a function template cannot be a friend of a local class
11+
> 'function': a function template cannot be a `friend` of a local class
1212
13-
A local class cannot have a function template as a friend function.
13+
A local class can't have a function template as a `friend` function.
1414

1515
The following sample generates C2701:
1616

docs/error-messages/compiler-errors-2/compiler-error-c2768.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ ms.assetid: a7f6047a-6a80-4737-ad5c-c12868639fb5
88
---
99
# Compiler Error C2768
1010

11-
'function' : illegal use of explicit template arguments
11+
> 'function': illegal use of explicit template arguments
1212
13-
The compiler was unable to determine if a function definition was supposed to be an explicit specialization of a function template or if the function definition was supposed to be for a new function.
13+
## Remarks
14+
15+
The compiler was unable to determine if a function definition was an explicit specialization of a function template or if it was a new function.
1416

1517
This error was introduced in Visual Studio .NET 2003, as part of the compiler conformance enhancements.
1618

19+
## Example
20+
1721
The following sample generates C2768:
1822

1923
```cpp

0 commit comments

Comments
 (0)