{"width":"100%","provider_name":"Hatena Blog","published":"2013-01-02 00:00:00","height":"190","type":"rich","blog_url":"https://yohhoy.hatenadiary.jp/","description":"C++11\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u63d0\u4f9b\u306estd::unique_ptr\u30af\u30e9\u30b9\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u306f\u3001\u7b2c1\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5f15\u6570\u306b\u914d\u5217\u578bT[]\u3092\u6307\u5b9a\u3057\u305f\u3068\u304d\u306e\u307f\u6dfb\u5b57\u30a2\u30af\u30bb\u30b9\uff08[]\u6f14\u7b97\u5b50\uff09\u3092\u5229\u7528\u53ef\u80fd\u3068\u306a\u308b\u3002\u305f\u3060\u3057\u3001\u3053\u306e\u90e8\u5206\u7279\u6b8a\u5316\u3067\u306f*\u6f14\u7b97\u5b50\u3068->\u6f14\u7b97\u5b50\u306f\u63d0\u4f9b\u3055\u308c\u306a\u3044\u3002 #include <memory> { std::unique_ptr<int> p1( new int(100) ); *p1 = 42; // OK p1[0] = 21; // NG: ill-formed } // \"delete p1.get()\"\u304c\u547c\u3073\u51fa\u3055\u308c\u308b { std::unique_ptr<int[]> p2( new int[10] \u2026","blog_title":"yohhoy\u306e\u65e5\u8a18","title":"std::unique_ptr\u3068\u6dfb\u5b57\u30a2\u30af\u30bb\u30b9","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20130102%2Fp1\" title=\"std::unique_ptr\u3068\u6dfb\u5b57\u30a2\u30af\u30bb\u30b9 - yohhoy\u306e\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","image_url":null,"author_name":"yohhoy","provider_url":"https://hatena.blog","url":"https://yohhoy.hatenadiary.jp/entry/20130102/p1","author_url":"https://blog.hatena.ne.jp/yohhoy/","categories":["C++"]}