Export (0) Print
Expand All
Expand Minimize

Compiler Error C3212

Error Message

'specialization' : an explicit specialization of a template member must be a member of an explicit specialization

An explicit specialization was ill formed.

The following sample generates C3212:

// C3212.cpp
// compile with: /LD
template <class T>
struct S {
   template <class T1>
   struct S1;
};


template <class T>   // C3212
template <>
struct S<T>::S1<int> {};

/*
// try the following instead
template <>
template <>
struct S<int>::S1<int> {};
*/

/*
// or, the following
template <>
struct S<int> {
   template <class T1>
   struct S1;
};

template <>
struct S<int>::S1<int> {
};
*/

Community Additions

ADD
Show:
© 2014 Microsoft