{"image_url":null,"width":"100%","height":"190","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffaithandbrave.hateblo.jp%2Fentry%2F2024%2F05%2F17%2F122445\" title=\"static_assert\u306e\u6bd4\u8f03\u5024\u3092\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u8868\u793a\u3059\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>","title":"static_assert\u306e\u6bd4\u8f03\u5024\u3092\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u8868\u793a\u3059\u308b","description":"C++\u306estatic_assert(A == B);\u306f\u8868\u660e\u5931\u6557\u6642\u306bfalse\u3068\u3044\u3046\u3053\u3068\u3057\u304b\u308f\u304b\u3089\u306a\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 GCC 12\u4ee5\u4e0a\u3001Clang 16\u4ee5\u4e0a\u3067\u3042\u308c\u3070\u3001\u6bd4\u8f03\u5024\u3092\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u8868\u793a\u3057\u3066\u304f\u308c\u307e\u3059\u3002 int main() { constexpr int a = 1; constexpr int b = 2; static_assert(a == b); } GCC : prog.cc: In function 'int main()': prog.cc:5:21: error: static assertion failed 5 | static_assert(a == b); |\u2026","author_name":"faith_and_brave","blog_title":"Faith and Brave - C++\u3067\u904a\u307c\u3046","categories":[],"version":"1.0","provider_url":"https://hatena.blog","type":"rich","published":"2024-05-17 12:24:45","author_url":"https://blog.hatena.ne.jp/faith_and_brave/","url":"https://faithandbrave.hateblo.jp/entry/2024/05/17/122445","blog_url":"https://faithandbrave.hateblo.jp/"}