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 Warning (level 1) C4253

'identifier' : forming a pointer-to-member requires explicit use of the address-of operator ('&') and a qualified name

A pointer to a non-static member function of a class or structure must have the form of an & followed by the qualified identifier not enclosed in parentheses. This warning is only issued under /Za.

The following sample generates C4253:

#include <stdio.h>

struct A {
   void f() {
      printf("test");
   }
};

int main() {   
   A a;
   A *as = new A;

   void (A::*p3)() =  A::f; // ok with -Ze, warning with -Za
   // the following line shows how to assign a pointer to a class member
   // from outside the class
   // void (A::*p3)() = &A::f;

   // calling member function from outside the class
   (as->*p3)();
   return 0;
}