'data type' : left of 'operator' must be a class, struct or union
To use a template parameter as if it is a class, specialize the class template with a class instead of an integral type.
The following sample generates C2651:
template<typename T, T::PMF pmf> struct X1 { }; struct Y1 { typedef void (Y1::*PMF)(); void mf() { } }; void f1() { X1<int, 0> x11; // Fails // X1<Y1, &Y1::mf> x12; // Works } void main(){}