Skip to content

Commit af5fddb

Browse files
Merge pull request #5618 from Rageking8/structure-error-references-in-range-c2671-c2700
Structure error references in range [C2671, C2700]
2 parents 966b45d + d94c130 commit af5fddb

25 files changed

+172
-119
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2671"
32
title: "Compiler Error C2671"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2671"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2671"]
66
helpviewer_keywords: ["C2671"]
7-
ms.assetid: fc0ee40f-c8f3-408f-b89d-745d149c4169
87
---
98
# Compiler Error C2671
109

11-
'function' : static member functions do not have 'this' pointers
10+
> 'function' : static member functions do not have 'this' pointers
11+
12+
## Remarks
1213

1314
A **`static`** member function tried to access **`this`**.
1415

15-
The following sample generates C2671:
16+
## Example
17+
18+
The following example generates C2671:
1619

1720
```cpp
1821
// C2671.cpp

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2-
description: "Learn more about: Compiler Error C2672"
32
title: "Compiler Error C2672"
4-
ms.date: "10/24/2017"
3+
description: "Learn more about: Compiler Error C2672"
4+
ms.date: 10/24/2017
55
f1_keywords: ["C2672"]
66
helpviewer_keywords: ["C2672"]
7-
ms.assetid: 7e86338a-2d4b-40fe-9dd2-ac6886f3f31a
87
---
98
# Compiler Error C2672
109

1110
> '*function*': no matching overloaded function found
1211
12+
## Remarks
13+
1314
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.
1415

1516
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: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2673"
32
title: "Compiler Error C2673"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2673"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2673"]
66
helpviewer_keywords: ["C2673"]
7-
ms.assetid: 780230c0-619b-4a78-b01d-ff5886306741
87
---
98
# Compiler Error C2673
109

11-
'function' : global functions do not have 'this' pointers
10+
> 'function' : global functions do not have 'this' pointers
11+
12+
## Remarks
1213

1314
A global function tried to access **`this`**.
1415

15-
The following sample generates C2673:
16+
## Example
17+
18+
The following example generates C2673:
1619

1720
```cpp
1821
// C2673.cpp

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2674"
32
title: "Compiler Error C2674"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2674"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2674"]
66
helpviewer_keywords: ["C2674"]
7-
ms.assetid: 7cbd70d8-d992-44d7-a5cb-dd8cf9c759d2
87
---
98
# Compiler Error C2674
109

11-
a generic declaration is not allowed in this context
10+
> a generic declaration is not allowed in this context
11+
12+
## Remarks
1213

1314
A generic was declared incorrectly. For more information, see [Generics](../../extensions/generics-cpp-component-extensions.md).
1415

1516
## Example
1617

17-
The following sample generates C2674.
18+
The following example generates C2674.
1819

1920
```cpp
2021
// C2674.cpp

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2675"
32
title: "Compiler Error C2675"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2675"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2675"]
66
helpviewer_keywords: ["C2675"]
7-
ms.assetid: 4b92a12b-bff8-4dd5-a109-620065fc146c
87
---
98
# Compiler Error C2675
109

11-
unary 'operator' : 'type' does not define this operator or a conversion to a type acceptable to the predefined operator
10+
> unary 'operator' : 'type' does not define this operator or a conversion to a type acceptable to the predefined operator
11+
12+
## Remarks
1213

1314
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.
1415

1516
## Example
1617

17-
The following sample generates C2675.
18+
The following example generates C2675.
1819

1920
```cpp
2021
// C2675.cpp

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: Compiler Error C2676"
32
title: "Compiler Error C2676"
3+
description: "Learn more about: Compiler Error C2676"
44
ms.date: 06/03/2022
55
f1_keywords: ["C2676"]
66
helpviewer_keywords: ["C2676"]
7-
ms.assetid: 838a5e34-c92f-4f65-a597-e150bf8cf737
87
---
98
# Compiler Error C2676
109

@@ -16,7 +15,7 @@ To use the operator, you must overload it for the specified type or define a con
1615

1716
## Examples
1817

19-
The following sample generates C2676.
18+
The following example generates C2676.
2019

2120
```cpp
2221
// C2676.cpp
@@ -50,7 +49,7 @@ C2676 can also occur if you attempt to do pointer arithmetic on the **`this`** p
5049
5150
The **`this`** pointer is of type handle in a reference type. For more information, see [Semantics of the `this` pointer](../../dotnet/how-to-define-and-consume-classes-and-structs-cpp-cli.md#BKMK_Semantics_of_the_this_pointer).
5251
53-
The following sample generates C2676.
52+
The following example generates C2676.
5453
5554
```cpp
5655
// C2676_a.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2677"
32
title: "Compiler Error C2677"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2677"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2677"]
66
helpviewer_keywords: ["C2677"]
7-
ms.assetid: 76bc0b65-f52a-45a6-b6d6-0555f89da9a8
87
---
98
# Compiler Error C2677
109

11-
binary 'operator' : no global operator found which takes type 'type' (or there is no acceptable conversion)
10+
> binary 'operator' : no global operator found which takes type 'type' (or there is no acceptable conversion)
11+
12+
## Remarks
1213

1314
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.
1415

15-
The following sample generates C2677:
16+
## Example
17+
18+
The following example generates C2677:
1619

1720
```cpp
1821
// C2677.cpp

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Error C2678"
32
title: "Compiler Error C2678"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2678"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2678"]
66
helpviewer_keywords: ["C2678"]
7-
ms.assetid: 1f0a4e26-b429-44f5-9f94-cb66441220c8
87
---
98
# Compiler Error C2678
109

11-
binary 'operator' : no operator defined which takes a left-hand operand of type 'type' (or there is no acceptable conversion)
10+
> binary 'operator' : no operator defined which takes a left-hand operand of type 'type' (or there is no acceptable conversion)
11+
12+
## Remarks
1213

1314
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.
1415

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

1718
## Examples
1819

19-
The following sample generates C2678 and shows how to fix it:
20+
The following example generates C2678 and shows how to fix it:
2021

2122
```cpp
2223
// C2678a.cpp
@@ -42,7 +43,7 @@ int main() {
4243
4344
C2678 can also occur if you do not pin a native member before calling a member function on it.
4445
45-
The following sample generates C2678 and shows how to fix it.
46+
The following example generates C2678 and shows how to fix it.
4647
4748
```cpp
4849
// C2678.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2679"
32
title: "Compiler Error C2679"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2679"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2679"]
66
helpviewer_keywords: ["C2679"]
7-
ms.assetid: 1a5f9d00-9190-4aa6-bc72-949f68ec136f
87
---
98
# Compiler Error C2679
109

11-
binary 'operator' : no operator found which takes a right-hand operand of type 'type' (or there is no acceptable conversion)
10+
> binary 'operator' : no operator found which takes a right-hand operand of type 'type' (or there is no acceptable conversion)
11+
12+
## Remarks
1213

1314
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.
1415

15-
The following sample generates C2679:
16+
## Example
17+
18+
The following example generates C2679:
1619

1720
```cpp
1821
// C2679.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2680"
32
title: "Compiler Error C2680"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2680"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2680"]
66
helpviewer_keywords: ["C2680"]
7-
ms.assetid: d6f7129e-dd17-4661-b680-18d6b925b1cc
87
---
98
# Compiler Error C2680
109

11-
'type' : invalid target type for name
10+
> 'type' : invalid target type for name
11+
12+
## Remarks
1213

1314
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.
1415

15-
The following sample generates C2680:
16+
## Examples
17+
18+
The following example generates C2680:
1619

1720
```cpp
1821
// C2680.cpp

0 commit comments

Comments
 (0)