Is it legal/well-defined C++ to call a non-static method that doesn’t access members through a null pointer?
This will probably work on most systems, but it is Undefined Behaviour. Quoth the Standard: 5.2.5.3 If E1 has the type “pointer to class X,” then the expression E1->E2 is converted to the equivalent form (*(E1)).E2 […] And: 5.2.5.1 A postfix expression followed by a dot . or an arrow ->, optionally followed by the … Read more