Sdílet prostřednictvím


Chyba kompilátoru C2991

redefinition parametru typu parameter 'parameter'

Poznámky

Došlo ke konfliktu typu mezi dvěma obecnými definicemi nebo definicemi šablony parameter. Při definování více obecných parametrů nebo parametrů šablony je nutné použít ekvivalentní typy.

Examples

Následující příklad generuje C2991:

// C2991.cpp
// compile with: /c
template<class T, class T> struct TC {};   // C2991
// try the following line instead
// template<class T, class T2> struct TC {};

K C2991 může také dojít při použití obecných typů:

// C2991b.cpp
// compile with: /clr /c
generic<class T,class T> ref struct GC {};   // C2991
// try the following line instead
// generic<class T,class T2> ref struct GC {};