{"image_url":null,"provider_name":"Hatena Blog","title":"explicit \u3067\u30ad\u30e3\u30b9\u30c8\u6f14\u7b97\u5b50\u306e\u6697\u9ed9\u306e\u578b\u5909\u63db\u3092\u6291\u5236\u3059\u308b","author_url":"https://blog.hatena.ne.jp/osyo-manga/","author_name":"osyo-manga","type":"rich","blog_url":"https://osyo-manga.hatenadiary.org/","published":"2013-03-18 20:05:34","width":"100%","url":"https://osyo-manga.hatenadiary.org/entry/20130318/1363604734","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fosyo-manga.hatenadiary.org%2Fentry%2F20130318%2F1363604734\" title=\"explicit \u3067\u30ad\u30e3\u30b9\u30c8\u6f14\u7b97\u5b50\u306e\u6697\u9ed9\u306e\u578b\u5909\u63db\u3092\u6291\u5236\u3059\u308b - C++\u3067\u30b2\u30fc\u30e0\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\" 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++ \u3067\u306f\u30ad\u30e3\u30b9\u30c8\u6f14\u7b97\u5b50\uff08operator T\uff09\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u578b\u304b\u3089\u578b\u3078\u6697\u9ed9\u306e\u578b\u5909\u63db\u3092\u884c\u3046\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002 struct X{ constexpr operator int() const{ return value; } int value; }; constexpr X x{42}; static_assert(x == 42, \"\"); constexpr int n = x; \u3053\u306e\u6642\u306b C++11 \u3067\u306f explicit \u3092\u4ed8\u3051\u308b\u3053\u3068\u3067\u6697\u9ed9\u306e\u578b\u5909\u63db\u3092\u884c\u3048\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002 [\u30bd\u30fc\u30b9] struct X{ constexpr explicit operator int()\u2026","version":"1.0","provider_url":"https://hatena.blog","categories":["C++"],"blog_title":"C++\u3067\u30b2\u30fc\u30e0\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0"}