Compiler Error C3857

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C3857.

type': multiple type parameter lists are not allowed

More than one template or generic was specified for the same type, which is not allowed.

The following sample generates C3857:

// C3857.cpp  
template <class T, class TT>  
template <class T2>    // C3857  
struct B {};  

Possible resolution:

// C3857b.cpp  
// compile with: /c  
template <class T, class TT, class T2>   
struct B {};  

C3857 can also occur when using generics:

// C3857c.cpp  
// compile with: /clr  
generic <typename T>  
generic <typename U>  
ref class GC;   // C3857  

Possible resolution:

// C3857d.cpp  
// compile with: /clr /c  
generic <typename U>  
ref class GC;  

Show: