Compiler Warning (level 4) C4516
TOC
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Compiler Warning (level 4) C4516

Error Message

'class::symbol' : access-declarations are deprecated; member using-declarations provide a better alternative

The ANSI C++ committee has declared access declarations (changing the access of a member in a derived class without the using keyword) to be outdated. Access declarations may not be supported by future versions of C++.

The following sample generates C4516:

// C4516.cpp
// compile with: /W4
class A
{
public:
   void x(char);
};

class B : protected A
{
public:
   A::x;  // C4516 on access-declaration
   // use the following line instead
   // using A::x; // using-declaration, ok
};

int main()
{
}
Show:
© 2016 Microsoft