Skip to content

Commit a948993

Browse files
authored
Merge pull request #5713 from Rageking8/improve-c2277-error-reference
Improve C2277 error reference
2 parents 8b3926e + dfa4b62 commit a948993

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
---
22
title: "Compiler Error C2277"
33
description: "Learn more about: Compiler Error C2277"
4-
ms.date: 11/04/2016
4+
ms.date: 08/27/2025
55
f1_keywords: ["C2277"]
66
helpviewer_keywords: ["C2277"]
77
---
88
# Compiler Error C2277
99

10-
> 'identifier' : cannot take address of this member function
10+
> '*function*': cannot take address of this member function
1111
1212
## Remarks
1313

14-
You cannot take the address of a member function.
14+
You cannot take the address of a [constructor](../../cpp/constructors-cpp.md) or [destructor](../../cpp/destructors-cpp.md). For more information, see [Address-of operator: `&`](../../cpp/address-of-operator-amp.md) and [Pointers to Members](../../cpp/pointers-to-members.md).
1515

1616
## Example
1717

1818
The following example generates C2277:
1919

2020
```cpp
21-
// C2277.cpp
22-
class A {
21+
// compile with: /c
22+
23+
class A
24+
{
2325
public:
2426
A();
2527
};
26-
(*pctor)() = &A::A; // C2277
28+
(*pctor)() = &A::A; // C2277
2729
```

0 commit comments

Comments
 (0)