Export (0) Print
Expand All
Expand Minimize

Compiler Error C3151

Error Message

'type' cannot apply __gc or __value to a template

A language keyword was applied to a template class, which is not allowed.

C3151 is only reachable using /clr:oldSyntax.

The following sample generates C3151:

// C3151.cpp
// compile with: /clr:oldSyntax /c
template <class T> __gc class X {};   // C3151
template <class T> class Y {};   // OK

Community Additions

ADD
Show:
© 2015 Microsoft