Compiler Error C2756
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 C2756

'template type' : default arguments not allowed on a partial specialization

The template for a partial specialization may not contain a default argument.

The following sample generates C2756:

// C2756.cpp
template <class T>
struct S {};

template <class T=int>
// try the following line instead
// template <class T>
struct S<T*> {};   // C2756
© 2015 Microsoft