Ref http://www.geeksforgeeks.org/some-interesting-facts-about-static-member-functions-in-c/ 1) static member functions do not have this pointer. 2) A static member function cannot be virtual (See thisG-Fact) 3) Member function declarations with the s…
Extraction from C++ primer 5th Edition 7.1.2 The purpose of the const that follows the parameter list of an ordinary member function is to modify the type of the implicit this pointer. By default, the type of this is a const pointer to the nonconst v…
Nested class types Usage and remark Advantage Disadvantage static member classes Use for public helper class, useful only in conjunction with its outer class. (Such as the operation types of a Calculater). Save memory. Class specific. Not instance sp…
Warning: Static member accessed via instance reference Shows references to static methods and fields via class instance rather than a class itself. 翻译: 通过引用实例来访问静态成员 通过类的实例来显示静态方法和变量的引用,而不是通过类本身 分析: 可能是考虑到实例会被回收 解决方案: 直接通过类本身来访问静态成员 例如: public class…