Compiler Error C2589
'identifier' : illegal token on right side of '::'
If a class, structure, or union name appears to the left of the scope-resolution operator (double colons), the token on the right must be a class, structure, or union member. Otherwise, any global identifier can appear on the right.
The scope-resolution operator cannot be overloaded.
The following sample generates C2589:
// C2589.cpp
void Test(){}
class A {};
void operator :: (); // C2589
int main() {
::Test();
}
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