Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Compiler Error C3182

'class' : a member using-declaration or access declaration is illegal within a managed or WinRT type

A using declaration is invalid within all forms of managed classes.

The following sample generates C3182 and shows how to fix it.

// C3182a.cpp
// compile with: /clr /c
ref struct B {
   void mf(int) {
   }
};

ref struct D : B {
   using B::mf;   // C3182, delete to resolve
   void mf(char) {
   }
};

The following sample generates C3182 and shows how to fix it.

// C3182b.cpp
// compile with: /clr:oldSyntax
#using <mscorlib.dll>

__gc struct B {
   void mf(int)
   {
   }
};

__gc struct D : B {
   using B::mf;   // C3182, delete to resolve
   void mf(char)
   {
   }
};

int main()
{
}
Show:
© 2015 Microsoft