Compiler Error C2754
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error C2754

'specialization' : a partial specialization cannot have a dependent non-type template parameter

An attempt was made to partially specialize a template class that has a dependent non-type template parameter. This is not allowed.

The following sample generates C2754:

// C2754.cpp
int i;
int ai[5];

template<class T, T t>
struct A

template<class T>
struct A<T,5>
};   // C2754
© 2016 Microsoft