{"image_url":null,"width":"100%","author_url":"https://blog.hatena.ne.jp/pebble8888/","title":"C++20\u3067std::vector\u3092\u7bc4\u56f2for\u3092\u9006\u9806\u306b\u3059\u308b","type":"rich","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpebble8888.hatenablog.com%2Fentry%2F2024%2F03%2F23%2F213613\" title=\"C++20\u3067std::vector\u3092\u7bc4\u56f2for\u3092\u9006\u9806\u306b\u3059\u308b - Pebble Coding\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","author_name":"pebble8888","version":"1.0","blog_title":"Pebble Coding","url":"https://pebble8888.hatenablog.com/entry/2024/03/23/213613","categories":[],"published":"2024-03-23 21:36:13","height":"190","blog_url":"https://pebble8888.hatenablog.com/","description":"C++11\u3067std::vector\u3092\u7bc4\u56f2for\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u304c\u3001\u9006\u9806\u306b\u306f\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 C++20\u306eranges\u306b\u3088\u308a\u9006\u9806\u3067\u7bc4\u56f2for\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 #include <vector> #include <ranges> std::vector<int> v = {0, 1, 2, 3}; for (const auto& a: v | std::views::reverse) { printf(\"%d \", a); } 3 2 1 0"}