Compiler Error C2460
'identifier1' : uses 'identifier2', which is being defined
A class or structure (identifier2
) is declared as a member of itself (identifier1
). Recursive definitions of classes and structures are not allowed.
The following sample generates C2460:
// C2460.cpp
class C {
C aC; // C2460
};
Instead, use a pointer reference in the class.
// C2460.cpp
class C {
C * aC; // 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