Compiler Error C2495
'identifier' : 'nothrow' can only be applied to function declarations or definitions
The nothrow extended attribute can be applied to function declarations or definitions only.
The following sample generates C2495:
// C2495.cpp
// compile with: /c
__declspec(nothrow) class X { // C2495
int m_data;
} x;
__declspec(nothrow) void test(); // OK
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for