{"height":"190","provider_url":"https://hatena.blog","published":"2017-11-21 00:00:00","url":"https://yohhoy.hatenadiary.jp/entry/20171121/p1","type":"rich","image_url":null,"title":"C++ Synchronized Buffered Ostream","categories":["C++","C++2a"],"version":"1.0","author_name":"yohhoy","provider_name":"Hatena Blog","blog_title":"yohhoy\u306e\u65e5\u8a18","width":"100%","blog_url":"https://yohhoy.hatenadiary.jp/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20171121%2Fp1\" title=\"C++ Synchronized Buffered Ostream - yohhoy\u306e\u65e5\u8a18\" 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/yohhoy/","description":"C++2a(C++20)\u306b\u5411\u3051\u3066(PDF)P0053R6\u304c\u63a1\u629e\u3055\u308c\u3001\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u74b0\u5883\u4e0b\u3067\u306e\u30b9\u30c8\u30ea\u30fc\u30e0\u51fa\u529b\u6392\u4ed6\u5236\u5fa1\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u540c\u671f\u5316\u51fa\u529b\u30b9\u30c8\u30ea\u30fc\u30e0std::osyncstream\u304c\u8ffd\u52a0\u3055\u308c\u308b\u3002 // C++2a(C++20) #include <syncstream> #include <iostream> void thread1(int value) { // \u4e0b\u8a18\u884c\u306e\u51e6\u7406\u7d50\u679c\u304c\u30a2\u30c8\u30df\u30c3\u30af\u306b\u30b9\u30c8\u30ea\u30fc\u30e0\u51fa\u529b\u3055\u308c\u308b std::osyncstream(std::cout) << \"value=\" << value << '\\n'; } void thread2(int value) { // \u2026"}