description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|---|
Learn more about: Compiler Error C2158 |
Compiler Error C2158 |
11/04/2016 |
|
|
39028899-e95c-4809-8e65-6111118641ee |
'type' : #pragma make_public directive is currently supported for native non-template types only
The make_public pragma can only be applied to a native, non-template type.
The following sample generates C2158.
// C2158.cpp
// compile with: /clr /c
ref class A {};
#pragma make_public(A) // C2158
template< typename T >
class B {};
#pragma make_public(B) // C2158
#pragma make_public(B<int>) // C2158
void C () {}
#pragma make_public(C) // C2158
class D {};
#pragma make_public(D) // OK