NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error C2651

'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(){}