Compiler Error C2764
TOC
Collapse the table of content
Expand the table of content
This documentation is archived and is not being maintained.

Compiler Error C2764

Error Message

'param' : template parameter not used or deducible in partial specialization 'specialization'

A template parameter is not used in a partial specialization. This makes the partial specialization unusable because the template parameter cannot be deduced.

Example

The following sample generates C2764:

// C2764.cpp
#include <stdio.h>
template <class T1, class T2>
struct S  {
   int m_i;
};

template <class T1, class T2>
struct S<int, T2*> {   // C2764
// try the following line instead
// struct S<T1(*)(T2), T2*> {
   char m_c;
};

int main() {
   S<int, char> s1;
   S<void (*)(short), short *> s2;
   s2.m_c = 10;
   s1.m_i = s2.m_c;
   printf_s("%d\n", s1.m_i);
}
Show:
© 2016 Microsoft