{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkiririmode.hatenablog.jp%2Fentry%2F20090710%2Fp1\" title=\"\u30e1\u30bf\u95a2\u6570\u3067\u306f\u672c\u5f53\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u8a08\u7b97\u3057\u3066\u304f\u308c\u308b\u306e\u304b - \u7406\u7cfb\u5b66\u751f\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>","version":"1.0","url":"https://kiririmode.hatenablog.jp/entry/20090710/p1","author_url":"https://blog.hatena.ne.jp/kiririmode/","type":"rich","published":"2009-07-10 00:00:00","provider_name":"Hatena Blog","categories":["c++"],"provider_url":"https://hatena.blog","title":"\u30e1\u30bf\u95a2\u6570\u3067\u306f\u672c\u5f53\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u8a08\u7b97\u3057\u3066\u304f\u308c\u308b\u306e\u304b","height":"190","description":"\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3002 \u3092\u8a08\u7b97\u3059\u308b\u3002N=10 \u306a\u306e\u3067\u3001\u7b54\u3048\u306f 55 \u306b\u306a\u308b\u3002 template <int N> struct sum { static const int value = N + sum<N-1>::value; }; template <> struct sum<0> { static const int value = 0; }; int main() { return sum<10>::value; } \u30a2\u30bb\u30f3\u30d6\u30e9\u30b3\u30fc\u30c9\u3092\u5410\u304b\u305b\u3066\u307f\u308b\u3002 $ g++ -O0 -S template-meta.cpp \u4e2d\u8eab\u3092\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3002\u3053\u308c\u306f\u4e00\u90e8\u3060\u3051\u3069\u3001$55 \u304c eax \u306b\u5165\u3063\u3066 return \u2026","blog_url":"https://kiririmode.hatenablog.jp/","image_url":null,"blog_title":"\u7406\u7cfb\u5b66\u751f\u65e5\u8a18","width":"100%","author_name":"kiririmode"}