引述自《深入探索C++对象模型》2001:5:1版次,p-150

static member functions的主要特性就是它没有this指针,所以:

1、它不能直接存取其所在class中的nonstatic members;

2、它不能够被声明为const、volatile或virtual;

3、它不需要经由class object才被调用——虽然大部分时候它是这样被调用的.

 

所有的nonstatic member functions都需要对象的地址(以参数this指出);

static member functions(没有this指针)的类型是”函数指针“,而不是”指向member function之指针“.

相关文章:

  • 2021-11-30
  • 2022-01-31
  • 2022-01-03
  • 2021-07-16
  • 2021-11-30
  • 2021-12-14
  • 2021-08-23
猜你喜欢
  • 2021-11-30
  • 2021-11-30
  • 2021-08-10
  • 2021-11-30
  • 2021-11-30
相关资源
相似解决方案