{"author_name":"pebble8888","categories":["C++17"],"image_url":null,"width":"100%","url":"https://pebble8888.hatenablog.com/entry/2022/03/20/112543","version":"1.0","author_url":"https://blog.hatena.ne.jp/pebble8888/","published":"2022-03-20 11:25:43","type":"rich","provider_url":"https://hatena.blog","title":"C++17\u306estd::optional","provider_name":"Hatena Blog","blog_url":"https://pebble8888.hatenablog.com/","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpebble8888.hatenablog.com%2Fentry%2F2022%2F03%2F20%2F112543\" title=\"C++17\u306estd::optional - 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>","description":"C++17\u306estd::optional\u306f\u3088\u3044\u306e\u3067\u7a4d\u6975\u7684\u306b\u4f7f\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002 std::optional swift\u306eoptional\u3068\u540c\u3058\u3088\u3046\u306a\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 #include <string> #include <optional> struct Data { int x; int y; Data(int x, int y) : x(x) , y(y) { } }; std::optional<Data> makeData(int x, int y) { if (y == 0) { return std::nullopt; } return std::make_option\u2026","blog_title":"Pebble Coding"}