所谓的仿函数(functor),是通过重载()运算符模拟函数形为的类。
因此,这里需要明确两点:
1 仿函数不是函数,它是个类;
2 仿函数重载了()运算符,使得它的对你可以像函数那样子调用(代码的形式好像是在调用
函数)。
reference:
http://hi.baidu.com/laodun/blog/item/eb8eb619bfd47b4143a9ad95.html
http://hi.baidu.com/laodun/blog/item/ffcc8f82e2108694f603a696.html
https://m.sciencenet.cn/blog-284809-248359.html
上一篇:
Trait Class下一篇:
[转]为什么陆涛不爱米莱——很长 很经典 很深刻