Compiler Error C2510
'identifier' : left of '::' must be a class/struct/union
A class, structure, or union name must appear on the left side of the scope-resolution operator (::
) operator.
The following sample generates C2510:
// C2510.cpp
struct S {
static const int x = 1;
};
int main() {
S s;
int num1 = s::x; // C2510
int num2 = S::x; // OK
}
Зворотний зв’язок
https://aka.ms/ContentUserFeedback.
Очікується незабаром: протягом 2024 року ми будемо припиняти використання механізму реєстрації проблем у GitHub для зворотного зв’язку щодо вмісту й замінювати його новою системою зворотного зв’язку. Докладніше:Надіслати й переглянути відгук про