Skip to content

Commit dfe1374

Browse files
author
Colin Robertson
committed
Address cpp-docs-3239
1 parent b50a678 commit dfe1374

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
description: "Learn more about: Compiler Error C2259"
33
title: "Compiler Error C2259"
4-
ms.date: "11/04/2016"
4+
ms.date: 07/08/2021
55
f1_keywords: ["C2259"]
66
helpviewer_keywords: ["C2259"]
77
ms.assetid: e458236f-bdea-4786-9aa6-a98d8bffa5f4
88
---
99
# Compiler Error C2259
1010

11-
'class' : cannot instantiate abstract class
11+
> '*class*' : cannot instantiate abstract class
1212
1313
Code declares an instance of an abstract class or structure.
1414

@@ -43,7 +43,7 @@ There are two possible workarounds for the problem:
4343
4444
- Use the scope resolution operator for the interface methods implemented in the derived class to qualify the implemented method name with the name of the interface.
4545
46-
C2259 can also occur as a result of conformance work that was done in Visual Studio 2005, **/Zc:wchar_t** is now on by default. In this situation, C2599 can be resolved either by compiling with **/Zc:wchar_t-**, to get the behavior from previous versions, or preferably, by updating your types so they are compatible. For more information, see [/Zc:wchar_t (wchar_t Is Native Type)](../../build/reference/zc-wchar-t-wchar-t-is-native-type.md).
46+
C2259 can also occur as a result of conformance work that was done in Visual Studio 2005, **`/Zc:wchar_t`** is now on by default. In this situation, C2599 can be resolved either by compiling with **`/Zc:wchar_t-`**, to get the behavior from previous versions, or preferably, by updating your types so they are compatible. For more information, see [`/Zc:wchar_t` (wchar_t Is Native Type)](../../build/reference/zc-wchar-t-wchar-t-is-native-type.md).
4747
4848
The following sample generates C2259:
4949
@@ -96,9 +96,7 @@ ref class MyDerivedClass: public MyInterface {
9696
private:
9797
// Uncomment the following line to resolve.
9898
// public:
99-
void MyMethod(){}
100-
// or the following line
101-
// void MyInterface::MyMethod() {};
99+
virtual void MyMethod(){}
102100
};
103101

104102
int main() {

0 commit comments

Comments
 (0)