avatar
s*t
1
看了TCPL的intro部分,太tmd神奇了。
mem_fun() accepts a pointer to a member function of some class as its
arugment, then generates a function that takes an object of that class as
its argument.
that means, a pointer to a member function of some class is in fact not a
pointer to a function, instead, it contains information of both the class
and the member function.
avatar
m*e
2
Or we can say it's too complicated. Even such a simple matter would have to
be explained by a book.

【在 s*******t 的大作中提到】
: 看了TCPL的intro部分,太tmd神奇了。
: mem_fun() accepts a pointer to a member function of some class as its
: arugment, then generates a function that takes an object of that class as
: its argument.
: that means, a pointer to a member function of some class is in fact not a
: pointer to a function, instead, it contains information of both the class
: and the member function.

avatar
o*e
3
呵呵,没用过 STL 做 functional programming 么
pointer to member function 效率比较低,mem_fun(ptr_fun) 还不如 FunObject()

【在 s*******t 的大作中提到】
: 看了TCPL的intro部分,太tmd神奇了。
: mem_fun() accepts a pointer to a member function of some class as its
: arugment, then generates a function that takes an object of that class as
: its argument.
: that means, a pointer to a member function of some class is in fact not a
: pointer to a function, instead, it contains information of both the class
: and the member function.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。