{"type":"rich","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20170820%2Fp1\" title=\"Designated Initialization @ C++ - 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>","image_url":null,"version":"1.0","author_url":"https://blog.hatena.ne.jp/yohhoy/","title":"Designated Initialization @ C++","categories":["C++","C++2a","C"],"blog_url":"https://yohhoy.hatenadiary.jp/","author_name":"yohhoy","width":"100%","provider_url":"https://hatena.blog","url":"https://yohhoy.hatenadiary.jp/entry/20170820/p1","height":"190","published":"2017-08-20 00:00:00","blog_title":"yohhoy\u306e\u65e5\u8a18","description":"C++2a(C++20)\u3067\u5c0e\u5165\u4e88\u5b9a\u306eDesignated Initialization\uff08\u6307\u793a\u4ed8\u304d\u306e\u521d\u671f\u5316\uff09\u3064\u3044\u3066\u30e1\u30e2\u3002C99\u3067\u306e\u540c\u4e00\u8a00\u8a9e\u6a5f\u80fd\u3092\u30d9\u30fc\u30b9\u3068\u3059\u308b\u304c\u3001\u4e00\u90e8\u6a5f\u80fd\u5236\u9650\u3055\u308c\u305f\u5f62\u3067C++\u306b\u5c0e\u5165\u3055\u308c\u308b\u3002 // C++2a(C++20) struct Point { int x, y; }; void f(Point); f({ .x = 100, .y = 50 }); // OK: Designated Initialization // \u6307\u793a\u5b50\u9806==\u30e1\u30f3\u30d0\u5ba3\u8a00\u9806 \u304c\u6761\u4ef6 f({ .y = 50, .x = 100 }); // NG C++2a\u8a00\u8a9e\u6a5f\u80fd\u3068C99\u8a00\u8a9e\u6a5f\u80fd\u3068\u306e\u5dee\u7570\u306f\u4e0b\u8868\u306e\u901a\u308a\uff08P\u2026"}