首页 > 其他 > 详细

for_each 使用总结

时间:2014-03-06 05:00:44      阅读:422      评论:0      收藏:0      [点我收藏+]
classMyClass{public:voidMethod()const;}

std::map<int,MyClass>Map;//...

std::vector<MyClass*>Vector;
std::transform(Map.begin(),Map.end(), std::back_inserter(Vector), std::mem_fun_ref(&std::map<int,MyClass>::value_type::second));
std::for_each(Vector.begin(),Vector.end(), std::mem_fun(&MyClass::Method));

for_each 使用总结,布布扣,bubuko.com

for_each 使用总结

原文:http://www.cnblogs.com/xiushenxiuxin/p/3582940.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!