We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
练习19.14
class Screen { public: typedef std::string::size_type pos; char get_cursor() const { return contents[cursor]; } char get() const; char get(pos ht, pos wd) const; private: std::string contents; pos cursor; pos height, width; };
get_curcor返回类型为char 故以下代码
auto pmf = &Screen::get_cursor; pmf = &Screen::get;
合法,含义为: 第一步,推导出pmf的类型(auto)为char (Screen::*)() const ,并将指向get_cursor成员函数的指针赋给pmf 第二步,将指向成员函数char get()const的指针赋值给pmf
char (Screen::*)() const
char get()const
The text was updated successfully, but these errors were encountered:
No branches or pull requests
练习19.14
get_curcor返回类型为char
故以下代码
auto pmf = &Screen::get_cursor; pmf = &Screen::get;
合法,含义为:
第一步,推导出pmf的类型(auto)为
char (Screen::*)() const
,并将指向get_cursor成员函数的指针赋给pmf第二步,将指向成员函数
char get()const
的指针赋值给pmfThe text was updated successfully, but these errors were encountered: