{"published":"2019-12-14 16:13:52","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsecret-garden.hatenablog.com%2Fentry%2F2019%2F12%2F14%2F161352\" title=\"\u3010\u4e00\u4eba C++20 Advent Calendar 2019\u3011consteval \u6307\u5b9a\u5b50\u3092\u8ffd\u52a0\u301014\u65e5\u76ee\u3011 - Secret Garden(Instrumental)\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","categories":["C++","C++20"],"author_url":"https://blog.hatena.ne.jp/osyo-manga/","provider_url":"https://hatena.blog","height":"190","description":"\u4e00\u4eba C++20 Advent Calendar 2019 14\u65e5\u76ee\u306e\u8a18\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 consteval \u6307\u5b9a\u5b50\u3092\u8ffd\u52a0 consteval \u3068\u306f\u5373\u6642\u95a2\u6570\u3092\u793a\u3059\u70ba\u306e\u6307\u5b9a\u5b50\u3067\u3059\u3002 \u5373\u6642\u95a2\u6570\u3068\u306f\u305d\u306e\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\u304c\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u5b9a\u6570\u5f0f\u3092\u751f\u6210\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3053\u3068\u3092\u6307\u3057\u307e\u3059\u3002 // \u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u5b9a\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u6642\u306e\u307f\u547c\u3079\u308b consteval int sqr(int n) { return n * n; } // OK: \u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u5b9a\u6570\u306b\u306a\u308b constexpr int n1 = sqr(4); static_assert(n1 == 16); int n2 = 3; // NG: \u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u5b9a\u6570\u2026","type":"rich","blog_title":"Secret Garden(Instrumental)","image_url":null,"url":"https://secret-garden.hatenablog.com/entry/2019/12/14/161352","width":"100%","blog_url":"https://secret-garden.hatenablog.com/","author_name":"osyo-manga","provider_name":"Hatena Blog","title":"\u3010\u4e00\u4eba C++20 Advent Calendar 2019\u3011consteval \u6307\u5b9a\u5b50\u3092\u8ffd\u52a0\u301014\u65e5\u76ee\u3011"}