{"url":"https://rhysd.hatenablog.com/entry/2014/01/06/030729","provider_url":"https://hatena.blog","image_url":null,"published":"2014-01-06 03:07:29","author_url":"https://blog.hatena.ne.jp/rhysd/","height":"190","title":" \u30af\u30e9\u30b9\u30b9\u30b3\u30fc\u30d7\u306e\u5909\u6570\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8","version":"1.0","description":"\u30af\u30e9\u30b9\u30b9\u30b3\u30fc\u30d7\u3067\u306f\uff0c\u5909\u6570\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306f\u9759\u7684\u306a\u30e1\u30f3\u30d0\u5909\u6570\u3067\u3057\u304b\u4f7f\u3048\u306a\u3044\uff0e struct X { // OK template<class T> static T hoge = T{}; // NG template<class T> T huga = T{}; }; \u306a\u306e\u3067\uff0c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3054\u3068\u306b\u30e1\u30f3\u30d0\u5909\u6570\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u6301\u3064\u3068\u3044\u3046\u3053\u3068\u306f\u3067\u304d\u306a\u3044\uff0e \u5c11\u306a\u304f\u3068\u3082\u73fe\u6642\u70b9\u3067\u306e clang \u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u306f\u3069\u3053\u304c\u307e\u305a\u3044\u306e\u304b\u6c17\u3065\u3051\u306a\u304b\u3063\u305f\uff0e error: member 'huga' declared as template non static data member initializer \u306f C++1\u2026","blog_url":"https://rhysd.hatenablog.com/","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Frhysd.hatenablog.com%2Fentry%2F2014%2F01%2F06%2F030729\" title=\" \u30af\u30e9\u30b9\u30b9\u30b3\u30fc\u30d7\u306e\u5909\u6570\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 - \u306f\u3084\u304f\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u306a\u308a\u305f\u3044\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","type":"rich","categories":["C++"],"author_name":"rhysd","blog_title":"\u306f\u3084\u304f\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u306a\u308a\u305f\u3044"}