https://stackoverflow.com/questions/670734/what-is-a-pointer-to-class-data-member-and-what-is-its-use
#面向对象程序设计
#面向对象程序设计
Stack Overflow
What is a pointer to class data member "::*" and what is its use?
I came across this strange code snippet which compiles fine:
class Car
{
public:
int speed;
};
int main()
{
int Car::*pSpeed = &Car::speed;
return 0;
}
Why does C++ have this
class Car
{
public:
int speed;
};
int main()
{
int Car::*pSpeed = &Car::speed;
return 0;
}
Why does C++ have this
https://github.com/supertuxkart/stk-code/blob/c563ba16584af14bdb97bb6149349735a00a9ccb/src/main.cpp#L2841
#未分类
#未分类
GitHub
stk-code/src/main.cpp at c563ba16584af14bdb97bb6149349735a00a9ccb · supertuxkart/stk-code
The code base of supertuxkart. Contribute to supertuxkart/stk-code development by creating an account on GitHub.