Skip to content

Commit 22a615c

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2671, C2700]
1 parent f993805 commit 22a615c

24 files changed

+78
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: fc0ee40f-c8f3-408f-b89d-745d149c4169
1010

1111
> 'function' : static member functions do not have 'this' pointers
1212
13+
## Remarks
14+
1315
A **`static`** member function tried to access **`this`**.
1416

17+
## Example
18+
1519
The following sample generates C2671:
1620

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 7e86338a-2d4b-40fe-9dd2-ac6886f3f31a
1010

1111
> '*function*': no matching overloaded function found
1212
13+
## Remarks
14+
1315
The compiler could not find an overloaded function that matches the specified function. No function was found that takes matching parameters, or no matching function has the required accessibility in context.
1416

1517
When used by certain standard library containers or algorithms, your types must provide accessible members or friend functions that satisfy the requirements of the container or algorithm. For example, your iterator types should derive from `std::iterator<>`. Comparison operations or use of other operators on container element types may require the type be considered as both a left-hand and a right-hand operand. Use of the type as a right-hand operand can require implementation of the operator as a non-member function of the type.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 780230c0-619b-4a78-b01d-ff5886306741
1010

1111
> 'function' : global functions do not have 'this' pointers
1212
13+
## Remarks
14+
1315
A global function tried to access **`this`**.
1416

17+
## Example
18+
1519
The following sample generates C2673:
1620

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 7cbd70d8-d992-44d7-a5cb-dd8cf9c759d2
1010

1111
> a generic declaration is not allowed in this context
1212
13+
## Remarks
14+
1315
A generic was declared incorrectly. For more information, see [Generics](../../extensions/generics-cpp-component-extensions.md).
1416

1517
## Example

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 4b92a12b-bff8-4dd5-a109-620065fc146c
1010

1111
> unary 'operator' : 'type' does not define this operator or a conversion to a type acceptable to the predefined operator
1212
13+
## Remarks
14+
1315
C2675 can also occur when using a unary operator, and the type does not define the operator or a conversion to a type acceptable to the predefined operator. To use the operator, you must overload it for the specified type or define a conversion to a type for which the operator is defined.
1416

1517
## Example

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 76bc0b65-f52a-45a6-b6d6-0555f89da9a8
1010

1111
> binary 'operator' : no global operator found which takes type 'type' (or there is no acceptable conversion)
1212
13+
## Remarks
14+
1315
To use the operator, you must overload it for the specified type or define a conversion to a type for which the operator is defined.
1416

17+
## Example
18+
1519
The following sample generates C2677:
1620

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 1f0a4e26-b429-44f5-9f94-cb66441220c8
1010

1111
> binary 'operator' : no operator defined which takes a left-hand operand of type 'type' (or there is no acceptable conversion)
1212
13+
## Remarks
14+
1315
To use the operator, you must overload it for the specified type or define a conversion to a type for which the operator is defined.
1416

1517
C2678 can occur when the left-hand operand is const-qualified but the operator is defined to take a non-const argument.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 1a5f9d00-9190-4aa6-bc72-949f68ec136f
1010

1111
> binary 'operator' : no operator found which takes a right-hand operand of type 'type' (or there is no acceptable conversion)
1212
13+
## Remarks
14+
1315
To use the operator, you must overload it for the specified type or define a conversion to a type for which the operator is defined.
1416

17+
## Example
18+
1519
The following sample generates C2679:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: d6f7129e-dd17-4661-b680-18d6b925b1cc
1010

1111
> 'type' : invalid target type for name
1212
13+
## Remarks
14+
1315
A casting operator tried to convert to a type that is not a pointer or reference. The [dynamic_cast](../../cpp/dynamic-cast-operator.md) operator can be used only for pointers or references.
1416

17+
## Examples
18+
1519
The following sample generates C2680:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: eb42da6d-8d2c-43fd-986b-e73e2b004885
1010

1111
> 'type' : invalid expression type for name
1212
13+
## Remarks
14+
1315
A casting operator tried to convert from an invalid type. For example, if you use the [dynamic_cast](../../cpp/dynamic-cast-operator.md) operator to convert an expression to a pointer type, the source expression must be a pointer.
1416

17+
## Example
18+
1519
The following sample generates C2681:
1620

1721
```cpp

0 commit comments

Comments
 (0)