Compiler Error C2886
'class::identifier' : symbol cannot be used in a member using-declaration
A using
declaration uses a symbol, such as a namespace name. A using
declaration is for declaring base class members.
The following sample generates C2886:
// C2886.cpp
// compile with: /c
namespace Z {
int i;
}
class B {
protected:
int i;
};
class D : public B {
// Error: Z is a namespace
using Z::i; // C2886
// OK: B is a base class
using B::i;
};
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