摘要:
回调函数(callback)与仿函数(functor)很多时候从用途上来看很相似,以致于我们经常将它们相提并论。例如:inline bool compare(int a, int b){ return a > b;} struct comparer { bool operator()(int a, int b) const { return a > b; }}; void main(){ std::vector<int> vec, vec2; std::sort(vec.begin(), vec.end(), compare); std::sort(vec2.beg.. 阅读全文
posted @ 2012-09-17 17:46
Zhaoyier
阅读(379)
评论(0)
推荐(0)

浙公网安备 33010602011771号