Compiler Error C2723
'function' : 'specifier' specifier illegal on function definition
The specifier cannot appear with a function definition outside of a class declaration. The virtual
specifier can be specified only on a member function declaration within a class declaration.
The following sample generates C2723 and shows how to fix it:
// C2723.cpp
struct X {
virtual void f();
virtual void g();
};
virtual void X::f() {} // C2723
// try the following line instead
void X::g() {}
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