{"width":"100%","categories":["C++"],"provider_name":"Hatena Blog","title":"\u5236\u7d04\u5f0fstd::bool_constant<cond>::value","author_name":"yohhoy","type":"rich","version":"1.0","blog_title":"yohhoy\u306e\u65e5\u8a18","provider_url":"https://hatena.blog","image_url":null,"description":"C++20 \u5236\u7d04\u5f0f(constraint-expression)\u3067\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u4f9d\u5b58\u3059\u308b\u5b9a\u6570\u6761\u4ef6\u5f0fcond\u3092\u8868\u73fe\u3059\u308b\u5834\u5408\u3001\u975e\u5b9a\u6570\u5f0f\u306b\u8d77\u56e0\u3059\u308b\u30cf\u30fc\u30c9\u30a8\u30e9\u30fc\u3092\u9632\u3050\u305f\u3081std::bool_constant<cond>::value\u3068\u8a18\u8ff0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002 #include <type_traits> struct X { // X::value\u306f\u975e\u5b9a\u6570\u5f0f static inline int value = 42; }; struct Y { // Y::value\u306f\u5b9a\u6570\u5f0f static constexpr inline int value = 42; }; struct Z {}; temp\u2026","url":"https://yohhoy.hatenadiary.jp/entry/20210307/p1","height":"190","author_url":"https://blog.hatena.ne.jp/yohhoy/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20210307%2Fp1\" title=\"\u5236\u7d04\u5f0fstd::bool_constant&lt;cond&gt;::value - 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>","blog_url":"https://yohhoy.hatenadiary.jp/","published":"2021-03-07 00:00:00"}