{"provider_name":"Hatena Blog","blog_url":"https://www.little-cuckoo.jp/","width":"100%","categories":["C++","Python"],"description":"\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067has_parent\u304ctrue\u306b\u306a\u308b\u306e\u89e3\u91c8\u9055\u3044\u3060\u3063\u305f\u2014 wata_d (@wata_d) 2021\u5e7410\u670827\u65e5 #include <filesystem> namespace fs = std::filesystem; int main() { fs::path path(R\"(C:\\Users\\Public\\Documents)\"); while (path.has_parent_path()) { std::cout << path.stem() << std::endl; path = path.parent_path(); } return 0; } \u307f\u305f\u3044\u306a\u30b3\u30fc\u2026","type":"rich","blog_title":"\u9591\u53e4\u9ce5","author_name":"wata_d","image_url":null,"published":"2021-10-28 21:34:56","provider_url":"https://hatena.blog","url":"https://www.little-cuckoo.jp/entry/2021/10/28/213456","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.little-cuckoo.jp%2Fentry%2F2021%2F10%2F28%2F213456\" title=\"\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067has_parent\u304cfalse\u306b\u306a\u308b\u3068\u601d\u3063\u3066\u3044\u305f - \u9591\u53e4\u9ce5\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/wata_d/","height":"190","version":"1.0","title":"\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067has_parent\u304cfalse\u306b\u306a\u308b\u3068\u601d\u3063\u3066\u3044\u305f"}