{"provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/wata_d/","url":"https://www.little-cuckoo.jp/entry/20051113/1131851845","height":"190","title":"Generic Template Method \u3092\u52d5\u7684\u306a\u591a\u614b\u306b\u5bfe\u5fdc\u3055\u305b\u308b\u306b\u306f","image_url":null,"provider_name":"Hatena Blog","published":"2005-11-13 12:17:25","categories":["programming","C++"],"description":"\u9577\u3044\u306e\u3067\u7d9a\u304f\u3002 #include <iostream> template<class T> struct base { void execute() { static_cast<T&>(*this).execute(); } }; struct hoge : public base<hoge> { void execute() { std::cout << \"hoge\" << std::endl; } }; struct foo : public base<foo> { void execute() { std::cout << \"foo\" << std::endl; } }; // \u2191\u306e\u3088\u3046\u2026","blog_url":"https://www.little-cuckoo.jp/","version":"1.0","width":"100%","type":"rich","blog_title":"\u9591\u53e4\u9ce5","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.little-cuckoo.jp%2Fentry%2F20051113%2F1131851845\" title=\"Generic Template Method \u3092\u52d5\u7684\u306a\u591a\u614b\u306b\u5bfe\u5fdc\u3055\u305b\u308b\u306b\u306f - \u9591\u53e4\u9ce5\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"wata_d"}