Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 600 Bytes

compiler-error-c2510.md

File metadata and controls

28 lines (23 loc) · 600 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C2510
Compiler Error C2510
11/04/2016
C2510
C2510
bf6d28db-f2f4-48f8-8f4e-7d662ed278fe

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
}