{"blog_title":"Faith and Brave - C++\u3067\u904a\u307c\u3046","author_name":"faith_and_brave","provider_name":"Hatena Blog","title":" C++1y bool\u3078\u306e\u5909\u63db\u6f14\u7b97\u5b50\u3092\u30b3\u30f3\u30c6\u30ca\u306b\u6301\u305f\u305b\u308b","height":"190","categories":["C++"],"provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/faith_and_brave/","type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffaithandbrave.hateblo.jp%2Fentry%2F20130125%2F1359098884\" title=\" C++1y bool\u3078\u306e\u5909\u63db\u6f14\u7b97\u5b50\u3092\u30b3\u30f3\u30c6\u30ca\u306b\u6301\u305f\u305b\u308b - Faith and Brave - C++\u3067\u904a\u307c\u3046\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","published":"2013-01-25 16:28:04","width":"100%","blog_url":"https://faithandbrave.hateblo.jp/","image_url":null,"description":"N3509 Operator Bool for Ranges std::vector\u3001std::string\u3068\u3044\u3063\u305f\u30b3\u30f3\u30c6\u30ca\u30af\u30e9\u30b9\u306b\u3001operator bool\u3092\u6301\u305f\u305b\u3088\u3046\u3001\u3068\u3044\u3046\u63d0\u6848\u3002 \u3053\u308c\u304c\u3042\u308b\u3068\u3001!empty()\u3092\u5fc5\u8981\u3068\u3059\u308b\u72b6\u6cc1\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5197\u9577\u6027\u3092\u89e3\u6d88\u3067\u304d\u308b\u3001\u3068\u3044\u3046\u306e\u304c\u52d5\u6a5f\u3067\u3059\u3002 // \u5f93\u6765\u306e\u65b9\u6cd5 string s = f(); if (!s.empty()) { // s\u3092\u4f7f\u3063\u305f\u51e6\u7406 } // operator bool\u304c\u3042\u308b\u5834\u5408 if (string s = f()) { // s\u3092\u4f7f\u3063\u305f\u51e6\u7406 } \u3053\u3046\u3044\u3046\u66f8\u304d\u65b9\u306f\u3001Boost.Optional\u3067\u3088\u304f\u4f7f\u3044\u307e\u3059\u3002\u6587\u5b57\u5217\u3060\u3068\u30011\u884c\u305a\u3064\u306e\u2026","version":"1.0","url":"https://faithandbrave.hateblo.jp/entry/20130125/1359098884"}