{"id":540,"date":"2007-02-13T00:32:28","date_gmt":"2007-02-12T15:32:28","guid":{"rendered":"http:\/\/dev.activebasic.com\/dai\/?p=540"},"modified":"2007-02-13T00:34:33","modified_gmt":"2007-02-12T15:34:33","slug":"540","status":"publish","type":"post","link":"https:\/\/dev.activebasic.com\/dai\/archives\/540","title":{"rendered":"C++\u3067foreach"},"content":{"rendered":"<p>vector\u306b\u8907\u6570\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u7a81\u3063\u8fbc\u3093\u3060\u3068\u304d\u306bfor\u6587\u3067\u3059\u3079\u3066\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8210\u3081\u305f\u3044\u3068\u304d\u3063\u3066\u3042\u308a\u307e\u3059\u3088\u306d\u3002\u5927\u4f53\u3001<\/p>\n<pre>vector&lt;string&gt; strings;\r\n\/\/\u3053\u3053\u3067strings\u306b\u4f55\u304b\u7a81\u3063\u8fbc\u3080\r\nfor( int i=0; i&lt;num; i++ ){\r\ncout &lt;&lt; strings[i];\r\n}<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u306e\u30b3\u30fc\u30c9\u306b\u306a\u308b\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u5b9f\u306f\u6700\u8fd1\u306eboost\u306f\u30a4\u30c6\u30ec\u30fc\u30c8\u3092\u81ea\u52d5\u7684\u306b\u51e6\u7406\u3057\u3066\u304f\u308c\u308bBOOST_FOREACH\u306a\u308b\u3082\u306e\u304c\u3042\u308b\u306e\u3067\u3059\u3002\u3069\u3046\u3084\u3063\u3066\u308b\u306e\u304b\u5206\u304b\u3063\u3061\u3083\u3044\u306a\u3044\u3093\u3067\u3059\u304c\u3001\u3068\u3066\u3082\u4fbf\u5229\u3067\u624b\u653e\u305b\u306a\u304f\u306a\u3063\u3066\u3044\u308b\u81ea\u5206\u304c\u3044\u307e\u3059\uff08\u6c57\uff09\u3002<\/p>\n<pre>vector&lt;string&gt; strings\r\n\/\/\u3053\u3053\u3067strings\u306b\u4f55\u304b\u7a81\u3063\u8fbc\u3080\r\nBOOST_FOREACH( string str, strings ){\r\ncout &lt;&lt; str;\r\n}<\/pre>\n<p>&#8220;BOOST_FOREACH&#8221; \u3063\u3066\u306e\u304c\u3061\u3087\u3063\u3068\u9577\u3044\u3057\u3001\u30bf\u30a4\u30d7\u3059\u308b\u306e\u304c\u5927\u5909\u305d\u3046\u306a\u306e\u3067\u3001\u304a\u3044\u3089\u306f &#8220;#define BOOST_FOREACH foreach&#8221; \u306a\u3069\u3068\u5b9a\u7fa9\u3057\u3066\u3057\u307e\u3063\u3066\u3044\u307e\u3059\u3002\u3082\u3046C++\u304c\u6a19\u6e96\u3067\u63d0\u4f9b\u3057\u3066\u3044\u308b\u304b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u306d\u3002<\/p>\n<p>\u3067\u3082\u3001\u3053\u306eBOOST_FOREACH\u306f\u307e\u3060boost\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u306f\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u3088\u3046\u306a\u306e\u3067\u3001\u5225\u9014\u4e0b\u8a18\u30b5\u30a4\u30c8\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u307f\u305f\u3044\u3067\u3059\uff08\u6700\u521d\u3053\u3053\u3067\u30cf\u30de\u308a\u307e\u3057\u305f\uff09\u3002<\/p>\n<p><a href=\"http:\/\/boost-consulting.com\/vault\/index.php?directory=Algorithms\">http:\/\/boost-consulting.com\/vault\/index.php?directory=Algorithms<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>vector\u306b\u8907\u6570\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u7a81\u3063\u8fbc\u3093\u3060\u3068\u304d\u306bfor\u6587\u3067\u3059\u3079\u3066\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8210\u3081\u305f\u3044\u3068\u304d\u3063\u3066\u3042\u308a\u307e\u3059\u3088\u306d\u3002\u5927\u4f53\u3001 vector&lt;string&gt; strings; \/\/\u3053\u3053\u3067strings\u306b\u4f55\u304b\u7a81\u3063\u8fbc\u3080  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-540","post","type-post","status-publish","format-standard","hentry","category-abdev"],"_links":{"self":[{"href":"https:\/\/dev.activebasic.com\/dai\/wp-json\/wp\/v2\/posts\/540"}],"collection":[{"href":"https:\/\/dev.activebasic.com\/dai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.activebasic.com\/dai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.activebasic.com\/dai\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.activebasic.com\/dai\/wp-json\/wp\/v2\/comments?post=540"}],"version-history":[{"count":0,"href":"https:\/\/dev.activebasic.com\/dai\/wp-json\/wp\/v2\/posts\/540\/revisions"}],"wp:attachment":[{"href":"https:\/\/dev.activebasic.com\/dai\/wp-json\/wp\/v2\/media?parent=540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.activebasic.com\/dai\/wp-json\/wp\/v2\/categories?post=540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.activebasic.com\/dai\/wp-json\/wp\/v2\/tags?post=540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}