`
nuaa_liu
  • 浏览: 25396 次
  • 性别: Icon_minigender_1
  • 来自: 南京
最近访客 更多访客>>
社区版块
存档分类
最新评论

boost_foreach

 
阅读更多

 

  1 #include <string>
  2 #include <iostream>
  3 #include <boost/foreach.hpp>
  4 
  5 #define foreach BOOST_FOREACH
  6 
  7 
  8 int main()
  9 {
 10     std::string hello("Hello,World!");
 11 
 12     foreach(char ch,hello)
 13     {
 14         std::cout << ch;
 15     }
 16 
 17     return 0;
 18 }

 支持类型:STL containers,arrays,Null-terminated strings,std::pair of iterators

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics