摘要: 只需定义一个宏:#define foreach(container,i) for(bool __foreach_ctrl__=true;__foreach_ctrl__;)\for(typedef typeof(container) __foreach_type__;__foreach_ctrl__;__foreach_ctrl__=false)\for(__foreach_type__::iterator i=container.begin();i!=container.end();i++)就可以这样遍历STL容器:std::list<int> list;list.insert( 阅读全文
posted @ 2011-05-21 18:16 TwilightSun 阅读(1054) 评论(1) 推荐(0) 编辑