Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 790 Bytes

File metadata and controls

32 lines (24 loc) · 790 Bytes
title Compiler Error C2277
description Learn more about: Compiler Error C2277
ms.date 08/27/2025
f1_keywords
C2277
helpviewer_keywords
C2277

Compiler Error C2277

'function': cannot take address of this member function

Remarks

You cannot take the address of a constructor or destructor. For more information, see Address-of operator: & and Pointers to Members.

Example

The following example generates C2277:

// C2277.cpp
// compile with: /c

struct S
{
    S() {}
    ~S() {}
};

void (S::* pointer_to_constructor)() = &S::S;   // C2277
void (S::* pointer_to_destructor)() = &S::~S;   // C2277